forked from BigfootDev/flatbuffers
[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:
@@ -19,7 +19,6 @@ package com.google.flatbuffers;
|
||||
import static com.google.flatbuffers.Constants.*;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.Buffer;
|
||||
|
||||
/// @file
|
||||
/// @addtogroup flatbuffers_java_api
|
||||
@@ -49,9 +48,9 @@ public class ByteBufferUtil {
|
||||
* size prefix
|
||||
*/
|
||||
public static ByteBuffer removeSizePrefix(ByteBuffer bb) {
|
||||
Buffer s = ((Buffer) bb).duplicate();
|
||||
ByteBuffer s = bb.duplicate();
|
||||
s.position(s.position() + SIZE_PREFIX_LENGTH);
|
||||
return (ByteBuffer) s;
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user