Package org.capnproto
Class BuilderArena
- java.lang.Object
-
- org.capnproto.BuilderArena
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuilderArena.AllocateResultstatic classBuilderArena.AllocationStrategy
-
Field Summary
Fields Modifier and Type Field Description ArrayList<SegmentBuilder>segmentsstatic BuilderArena.AllocationStrategySUGGESTED_ALLOCATION_STRATEGYstatic intSUGGESTED_FIRST_SEGMENT_WORDS
-
Constructor Summary
Constructors Constructor Description BuilderArena(int firstSegmentSizeWords, BuilderArena.AllocationStrategy allocationStrategy)BuilderArena(Allocator allocator)BuilderArena(Allocator allocator, ByteBuffer firstSegment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuilderArena.AllocateResultallocate(int amount)Allocates `amount` words in an existing segment or, if no suitable segment exists, in a new segment.voidcheckReadLimit(int numBytes)SegmentBuildergetSegment(int id)ByteBuffer[]getSegmentsForOutput()SegmentReadertryGetSegment(int id)
-
-
-
Field Detail
-
SUGGESTED_FIRST_SEGMENT_WORDS
public static final int SUGGESTED_FIRST_SEGMENT_WORDS
- See Also:
- Constant Field Values
-
SUGGESTED_ALLOCATION_STRATEGY
public static final BuilderArena.AllocationStrategy SUGGESTED_ALLOCATION_STRATEGY
-
segments
public final ArrayList<SegmentBuilder> segments
-
-
Constructor Detail
-
BuilderArena
public BuilderArena(int firstSegmentSizeWords, BuilderArena.AllocationStrategy allocationStrategy)
-
BuilderArena
public BuilderArena(Allocator allocator)
-
BuilderArena
public BuilderArena(Allocator allocator, ByteBuffer firstSegment)
-
-
Method Detail
-
tryGetSegment
public final SegmentReader tryGetSegment(int id)
- Specified by:
tryGetSegmentin interfaceArena
-
getSegment
public final SegmentBuilder getSegment(int id)
-
checkReadLimit
public final void checkReadLimit(int numBytes)
- Specified by:
checkReadLimitin interfaceArena
-
allocate
public BuilderArena.AllocateResult allocate(int amount)
Allocates `amount` words in an existing segment or, if no suitable segment exists, in a new segment.
-
getSegmentsForOutput
public final ByteBuffer[] getSegmentsForOutput()
-
-