mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Made reading read-only ByteBuffers work.
Also added new constructor that allows ByteBuffer reuse. Change-Id: I9c20ea96c67533066461f4e23b0d03b9b47cd068 Tested: on OS X.
This commit is contained in:
@@ -103,9 +103,12 @@ class JavaTest {
|
||||
}
|
||||
|
||||
// Test it:
|
||||
|
||||
TestBuffer(fbb.dataBuffer(), fbb.dataStart());
|
||||
|
||||
// Make sure it also works with read only ByteBuffers. This is slower, since
|
||||
// creating strings incurs an additional copy (see Table.__string).
|
||||
TestBuffer(fbb.dataBuffer().asReadOnlyBuffer(), fbb.dataStart());
|
||||
|
||||
System.out.println("FlatBuffers test: completed successfully");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user