public class TimestampEncoding extends CustomEncoding<com.google.cloud.Timestamp>
schema
Constructor and Description |
---|
TimestampEncoding() |
Modifier and Type | Method and Description |
---|---|
protected com.google.cloud.Timestamp |
read(java.lang.Object reuse,
Decoder in)
Deserializes a
Timestamp from the given Decoder . |
protected void |
write(java.lang.Object datum,
Encoder out)
Serializes a
Timestamp received as datum to the output encoder out. |
getSchema
protected void write(java.lang.Object datum, Encoder out) throws java.io.IOException
Timestamp
received as datum to the output encoder out. A null timestamp is
serialized with negative fields (seconds and nanos).write
in class CustomEncoding<com.google.cloud.Timestamp>
datum
- the Timestamp
to be encodedout
- the Encoder
where the timestamp should be serialized tojava.io.IOException
- if it was not possible to write the timestamp into the provided encoderprotected com.google.cloud.Timestamp read(java.lang.Object reuse, Decoder in) throws java.io.IOException
Timestamp
from the given Decoder
.read
in class CustomEncoding<com.google.cloud.Timestamp>
reuse
- ignoredin
- the Decoder
to read the timestamp fields fromTimestamp
instead.java.io.IOException
- if it was not possible to read the timestamp from the provided decoder