Ejemplo n.º 1
0
 @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);
 }
Ejemplo n.º 2
0
 @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);
 }