@Override public TimestampedValue<T> decode(InputStream inStream, Context context) throws IOException { T value = valueCoder.decode(inStream, context.nested()); Instant timestamp = InstantCoder.of().decode(inStream, context); return TimestampedValue.of(value, timestamp); }
@Override public void encode(TimestampedValue<T> windowedElem, OutputStream outStream, Context context) throws IOException { valueCoder.encode(windowedElem.getValue(), outStream, context.nested()); InstantCoder.of().encode(windowedElem.getTimestamp(), outStream, context); }