mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
added reuse option for root objects
getRootAs..() function now has a second implementation that accepts an existing object to allow object reuse, much like all other methods that refer to objects. Change-Id: Iffef567c903a130761ef7de98867e5465d29a04d
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
4d3db99283
commit
b0910e75e0
@@ -8,7 +8,8 @@ import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
public class Monster extends Table {
|
||||
public static Monster getRootAsMonster(ByteBuffer _bb) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (new Monster()).__init(_bb.getInt(_bb.position()) + _bb.position(), _bb); }
|
||||
public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); }
|
||||
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__init(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public static boolean MonsterBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONS"); }
|
||||
public Monster __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user