OIntegerSerializer.INSTANCE.serializeLiteral((startPosition - oldStartPosition), stream, oldStartPosition);
}
@SuppressWarnings("unchecked")
public OCompositeKey deserialize(byte[] stream, int startPosition) {
final OCompositeKey compositeKey = new OCompositeKey();
startPosition += OIntegerSerializer.INT_SIZE;
final int keysSize = OIntegerSerializer.INSTANCE.deserializeLiteral(stream, startPosition);
startPosition += OIntegerSerializer.INSTANCE.getObjectSize(keysSize);
final OBinarySerializerFactory factory = OBinarySerializerFactory.getInstance();
for (int i = 0; i < keysSize; i++) {
final byte serializerId = stream[startPosition];
startPosition += OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE;
OBinarySerializer<Object> binarySerializer = (OBinarySerializer<Object>) factory.getObjectSerializer(serializerId);
final Object key = binarySerializer.deserialize(stream, startPosition);
compositeKey.addKey(key);
startPosition += binarySerializer.getObjectSize(key);
}
return compositeKey;