mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 17:57:25 +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:
parent
8e40902d52
commit
4507594812
3 changed files with 24 additions and 3 deletions
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue