forked from BigfootDev/flatbuffers
avoiding NoSuchMethod exception (#6658)
This commit is contained in:
@@ -2,6 +2,7 @@ package com.google.flatbuffers;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.Buffer;
|
||||
|
||||
public class ByteBufferReadWriteBuf implements ReadWriteBuf {
|
||||
|
||||
@@ -117,9 +118,9 @@ public class ByteBufferReadWriteBuf implements ReadWriteBuf {
|
||||
public void set(int index, byte[] value, int start, int length) {
|
||||
requestCapacity(index + (length - start));
|
||||
int curPos = buffer.position();
|
||||
buffer.position(index);
|
||||
((Buffer) buffer).position(index);
|
||||
buffer.put(value, start, length);
|
||||
buffer.position(curPos);
|
||||
((Buffer) buffer).position(curPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,7 +155,7 @@ public class ByteBufferReadWriteBuf implements ReadWriteBuf {
|
||||
|
||||
@Override
|
||||
public int writePosition() {
|
||||
return buffer.position();
|
||||
return ((Buffer) buffer).position();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user