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; }
public int toStream(final OMemoryStream iStream) throws IOException { final int beginOffset = OBinaryProtocol.short2bytes((short) clusterId, iStream); iStream.write(clusterPosition.toStream()); return beginOffset; }