assertThat(timestamp.isExtensionValue(), is(true)); ExtensionValue tsInEventTime = timestamp.asExtensionValue(); assertThat(tsInEventTime.getType(), CoreMatchers.is((byte) 0x00)); ByteBuffer secondsAndNanoSeconds = ByteBuffer.wrap(tsInEventTime.getData()); int seconds = secondsAndNanoSeconds.getInt(); int nanoSeconds = secondsAndNanoSeconds.getInt();
if (extensionValue.getType() != 0) { throw new IllegalArgumentException("Unexpected extension type: " + extensionValue.getType()); byte[] data = extensionValue.getData(); long seconds = ByteBuffer.wrap(data, 0, 4).order(ByteOrder.BIG_ENDIAN).getInt(); long nanos = ByteBuffer.wrap(data, 4, 4).order(ByteOrder.BIG_ENDIAN).getInt();