Package org.wololo.flatgeobuf.geotools
Class FlatBuffers
- java.lang.Object
-
- org.wololo.flatgeobuf.geotools.FlatBuffers
-
public class FlatBuffers extends Object
Utility class to create and release the internal byte buffers of aFlatBufferBuilder.In order to either release or return to the cache the used buffers as soon as possible, use
newBuilder(int)andrelease(FlatBufferBuilder)as soon as possible, instead of expecting the GC to do it.- Implementation Note:
- Currently, the returned
buildersuse aFlatBufferBuilder.ByteBufferFactorythat uses GeoToolsNIOUtilitiescached buffers. This means that the buffers will be reused, but also that they'll be direct or heap buffers depending onNIOUtilities.isDirectBuffersEnabled(), hence the importance of callingrelease(FlatBufferBuilder)as soon as the builder is to be disposed, to the GeoTools utility can take care of cleaning up the direct buffers when needed.
-
-
Constructor Summary
Constructors Constructor Description FlatBuffers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.flatbuffers.FlatBufferBuildernewBuilder(int minimumCapacity)static voidrelease(com.google.flatbuffers.FlatBufferBuilder builder)
-