mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
avoiding NoSuchMethod exception (#6658)
This commit is contained in:
@@ -23,6 +23,7 @@ import static com.google.flatbuffers.FlexBuffers.Unsigned.shortToUnsignedInt;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/// @file
|
||||
@@ -688,7 +689,7 @@ public class FlexBuffers {
|
||||
*/
|
||||
public ByteBuffer data() {
|
||||
ByteBuffer dup = ByteBuffer.wrap(bb.data());
|
||||
dup.position(end);
|
||||
((Buffer) dup).position(end);
|
||||
dup.limit(end + size());
|
||||
return dup.asReadOnlyBuffer().slice();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user