mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 14:32:02 +00:00
fixed ArrayOutOfBoundsException in java example
This commit is contained in:
@@ -727,8 +727,8 @@ offsets.
|
|||||||
// Place the two weapons into an array, and pass it to the `createWeaponsVector()` method to
|
// Place the two weapons into an array, and pass it to the `createWeaponsVector()` method to
|
||||||
// create a FlatBuffer vector.
|
// create a FlatBuffer vector.
|
||||||
int[] weaps = new int[2];
|
int[] weaps = new int[2];
|
||||||
weaps[1] = sword;
|
weaps[0] = sword;
|
||||||
weaps[2] = axe;
|
weaps[1] = axe;
|
||||||
|
|
||||||
// Pass the `weaps` array into the `createWeaponsVector()` method to create a FlatBuffer vector.
|
// Pass the `weaps` array into the `createWeaponsVector()` method to create a FlatBuffer vector.
|
||||||
int weapons = Monster.createWeaponsVector(builder, weaps);
|
int weapons = Monster.createWeaponsVector(builder, weaps);
|
||||||
|
|||||||
Reference in New Issue
Block a user