mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
[Java] Avoid casting ByteBuffer to Buffer (#6785)
* Revert "avoiding even more NoSuchMethod exceptions (#6729)" This reverts commit6fb2c90d9e. * Revert "avoiding more NoSuchMethod exceptions (#6671)" This reverts commit752c7b576d. * Revert "avoiding NoSuchMethod exception (#6658)" This reverts commit813d3632ec. * Use Java 8 for Kotlin Linux builds to verify
This commit is contained in:
@@ -23,7 +23,6 @@ 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
|
||||
@@ -689,7 +688,7 @@ public class FlexBuffers {
|
||||
*/
|
||||
public ByteBuffer data() {
|
||||
ByteBuffer dup = ByteBuffer.wrap(bb.data());
|
||||
((Buffer) dup).position(end);
|
||||
dup.position(end);
|
||||
dup.limit(end + size());
|
||||
return dup.asReadOnlyBuffer().slice();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user