Commit ba20d9bf authored by Carlos Sanchez's avatar Carlos Sanchez Committed by Wouter van Oortmerssen

Added a clear function for purging all data that is holded by the FlatBuffer. (#4259)

parent 370693a2
...@@ -106,6 +106,22 @@ public class FlatBufferBuilder { ...@@ -106,6 +106,22 @@ public class FlatBufferBuilder {
return this; return this;
} }
/**
* Reset the FlatBufferBuilder by purging all data that it holds.
*/
public void clear(){
space = bb.capacity();
bb.clear();
minalign = 1;
while(vtable_in_use > 0) vtable[--vtable_in_use] = 0;
vtable_in_use = 0;
nested = false;
finished = false;
object_start = 0;
num_vtables = 0;
vector_num_elems = 0;
}
/// @cond FLATBUFFERS_INTERNAL /// @cond FLATBUFFERS_INTERNAL
/** /**
* Create a `ByteBuffer` with a given capacity. * Create a `ByteBuffer` with a given capacity.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment