@Override
  public byte[] toBytes() {
    byte[] buf = new byte[size()];
    ByteBuffer bufWrap = ByteBuffer.wrap(buf);
    bufWrap.putShort(version);
    bufWrap.putShort((short) type.ordinal());
    bufWrap.putLong(bytesRead);
    serializeNullableString(bufWrap, startContinuationToken);
    serializeNullableString(bufWrap, endContinuationToken);
    bufWrap.putInt(index);
    bufWrap.putInt(totalItems);
    serializeNullableString(bufWrap, cacheSessionId);
    return buf;
  }
Serialize {@link CosmosChangeFeedFindToken} to byte array.
@return serialized byte array.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/CosmosChangeFeedFindToken.java