diff options
author | svenk177 <50141814+svenk177@users.noreply.github.com> | 2019-06-18 00:15:13 +0200 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-06-18 00:15:13 +0200 |
commit | e635141d5bc66f056c90bcc9da5fdd766610492f (patch) | |
tree | b69da4d3b4d2e6e592083a2c31c6d7f809666575 /tests/MyGame/Example/ArrayTable.java | |
parent | 0d2cebccfeffae9df998f3ac819bf17b7ec7a6d0 (diff) | |
download | flatbuffers-e635141d5bc66f056c90bcc9da5fdd766610492f.tar.gz flatbuffers-e635141d5bc66f056c90bcc9da5fdd766610492f.tar.bz2 flatbuffers-e635141d5bc66f056c90bcc9da5fdd766610492f.zip |
Add support for fixed-size arrays (#5313)
Diffstat (limited to 'tests/MyGame/Example/ArrayTable.java')
-rw-r--r-- | tests/MyGame/Example/ArrayTable.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/MyGame/Example/ArrayTable.java b/tests/MyGame/Example/ArrayTable.java new file mode 100644 index 00000000..2ef18f66 --- /dev/null +++ b/tests/MyGame/Example/ArrayTable.java @@ -0,0 +1,30 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +package MyGame.Example; + +import java.nio.*; +import java.lang.*; +import java.util.*; +import com.google.flatbuffers.*; + +@SuppressWarnings("unused") +public final class ArrayTable extends Table { + public static ArrayTable getRootAsArrayTable(ByteBuffer _bb) { return getRootAsArrayTable(_bb, new ArrayTable()); } + public static ArrayTable getRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } + public static boolean ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "ARRT"); } + public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); } + public ArrayTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } + + public MyGame.Example.ArrayStruct a() { return a(new MyGame.Example.ArrayStruct()); } + public MyGame.Example.ArrayStruct a(MyGame.Example.ArrayStruct obj) { int o = __offset(4); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; } + + public static void startArrayTable(FlatBufferBuilder builder) { builder.startTable(1); } + public static void addA(FlatBufferBuilder builder, int aOffset) { builder.addStruct(0, aOffset, 0); } + public static int endArrayTable(FlatBufferBuilder builder) { + int o = builder.endTable(); + return o; + } + public static void finishArrayTableBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset, "ARRT"); } + public static void finishSizePrefixedArrayTableBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset, "ARRT"); } +} + |