mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-02 02:07:25 +00:00
Fixed a bugs in the Java runtime that could cause an index out of bounds exception.
Tested: on Windows. Change-Id: I0d4cdafc21690eb9a509ba31f21e80dacfb602ff
This commit is contained in:
parent
1256307a38
commit
350011f581
8 changed files with 32 additions and 29 deletions
|
|
@ -44,9 +44,12 @@ class JavaTest {
|
|||
TestBuffer(bb, 0);
|
||||
|
||||
// Second, let's create a FlatBuffer from scratch in Java, and test it also.
|
||||
// We set up the same values as monsterdata.json:
|
||||
// We use an initial size of 1 to exercise the reallocation algorithm,
|
||||
// normally a size larger than the typical FlatBuffer you generate would be
|
||||
// better for performance.
|
||||
FlatBufferBuilder fbb = new FlatBufferBuilder(1);
|
||||
|
||||
FlatBufferBuilder fbb = new FlatBufferBuilder(1024);
|
||||
// We set up the same values as monsterdata.json:
|
||||
|
||||
int str = fbb.createString("MyMonster");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue