get as stream: added compatibility with JDK 8
@@ -247,7 +247,8 @@ public final class CompositeKeySerializer implements OBinarySerializer<OComposit
}
public int getObjectSize(byte[] stream, int startPosition) {
- return ByteBuffer.wrap(stream).position(startPosition).getInt();
+ //noinspection RedundantCast
+ return ((ByteBuffer) ByteBuffer.wrap(stream).position(startPosition)).getInt();
}
public byte getId() {
@@ -255,16 +256,19 @@ public final class CompositeKeySerializer implements OBinarySerializer<OComposit
}
public int getObjectSizeNative(byte[] stream, int startPosition) {
- return ByteBuffer.wrap(stream).order(ByteOrder.nativeOrder()).position(startPosition).getInt();
+ //noinspection RedundantCast
+ return ((ByteBuffer) ByteBuffer.wrap(stream).order(ByteOrder.nativeOrder()).position(startPosition)).getInt();
}
public void serializeNativeObject(OCompositeKey compositeKey, byte[] stream, int startPosition, Object... hints) {
- final ByteBuffer buffer = ByteBuffer.wrap(stream).order(ByteOrder.nativeOrder()).position(startPosition);
+ @SuppressWarnings("RedundantCast")
+ final ByteBuffer buffer = (ByteBuffer) ByteBuffer.wrap(stream).order(ByteOrder.nativeOrder()).position(startPosition);
serialize(compositeKey, buffer, (OType[]) hints);
}
public OCompositeKey deserializeNativeObject(byte[] stream, int startPosition) {
- final ByteBuffer buffer = ByteBuffer.wrap(stream).order(ByteOrder.nativeOrder()).position(startPosition);
+ @SuppressWarnings("RedundantCast")
+ final ByteBuffer buffer = (ByteBuffer) ByteBuffer.wrap(stream).order(ByteOrder.nativeOrder()).position(startPosition);
return deserialize(buffer);
}
