private DataInputStream getSerializedStream(CosmosChangeFeedFindToken token) {
    byte[] buf = new byte[token.size()];
    ByteBuffer bufWrap = ByteBuffer.wrap(buf);
    bufWrap.putShort(token.getVersion());
    bufWrap.putShort((short) token.getType().ordinal());
    bufWrap.putLong(token.getBytesRead());
    Utils.serializeNullableString(bufWrap, token.getStartContinuationToken());
    Utils.serializeNullableString(bufWrap, token.getEndContinuationToken());
    bufWrap.putInt(token.getIndex());
    bufWrap.putInt(token.getTotalItems());
    Utils.serializeNullableString(bufWrap, token.getCacheSessionId());
    return new DataInputStream(new ByteArrayInputStream(buf));
  }
helper to serialize token.
@param token {@code AzureFindToken} object to serialize
@return DataInputStream serialized stream
ambry-cloud/src/test/java/com/github/ambry/cloud/azure/CosmosChangeFeedFindTokenTest.java