예제 #1
0
  public byte[] toStream() {
    final int serializedSize = OClusterPositionFactory.INSTANCE.getSerializedSize();

    byte[] buffer = new byte[OBinaryProtocol.SIZE_SHORT + serializedSize];

    OBinaryProtocol.short2bytes((short) clusterId, buffer, 0);
    System.arraycopy(
        clusterPosition.toStream(), 0, buffer, OBinaryProtocol.SIZE_SHORT, serializedSize);

    return buffer;
  }
예제 #2
0
 public int toStream(final OMemoryStream iStream) throws IOException {
   final int beginOffset = OBinaryProtocol.short2bytes((short) clusterId, iStream);
   iStream.write(clusterPosition.toStream());
   return beginOffset;
 }