avoiding NoSuchMethod exception (#6658)

This commit is contained in:
Kamil Rojewski
2021-05-24 20:09:45 +02:00
committed by GitHub
parent d84bccb0c7
commit 813d3632ec
7 changed files with 28 additions and 22 deletions

View File

@@ -19,6 +19,7 @@ package com.google.flatbuffers;
import static com.google.flatbuffers.Constants.*;
import java.nio.ByteBuffer;
import java.nio.Buffer;
/// @file
/// @addtogroup flatbuffers_java_api
@@ -49,7 +50,7 @@ public class ByteBufferUtil {
*/
public static ByteBuffer removeSizePrefix(ByteBuffer bb) {
ByteBuffer s = bb.duplicate();
s.position(s.position() + SIZE_PREFIX_LENGTH);
((Buffer) s).position(s.position() + SIZE_PREFIX_LENGTH);
return s;
}