Class ByteBufferBuilder
java.lang.Object
com.mojang.blaze3d.vertex.ByteBufferBuilder
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.lwjgl.system.MemoryUtil.MemoryAllocatorprivate static final intprivate longprivate static final longprivate intprivate static final org.slf4j.Loggerprivate static final intprivate final longprivate static final com.mojang.jtracy.MemoryPoolprivate longprivate longprivate intprivate long -
Constructor Summary
ConstructorsConstructorDescriptionByteBufferBuilder(int initialCapacity) ByteBufferBuilder(int initialCapacity, long maxCapacity) -
Method Summary
Modifier and TypeMethodDescription@Nullable ByteBufferBuilder.Resultbuild()private voidvoidclear()voidclose()voiddiscard()private voidprivate voidensureCapacity(long requiredCapacity) static ByteBufferBuilderexactlySized(int capacity) private voidprivate booleanisValid(int generation) longreserve(int size) private voidresize(long newCapacity)
-
Field Details
-
MEMORY_POOL
private static final com.mojang.jtracy.MemoryPool MEMORY_POOL -
LOGGER
private static final org.slf4j.Logger LOGGER -
ALLOCATOR
private static final org.lwjgl.system.MemoryUtil.MemoryAllocator ALLOCATOR -
DEFAULT_MAX_CAPACITY
private static final long DEFAULT_MAX_CAPACITY- See Also:
-
MAX_GROWTH_SIZE
private static final int MAX_GROWTH_SIZE- See Also:
-
BUFFER_FREED_GENERATION
private static final int BUFFER_FREED_GENERATION- See Also:
-
pointer
private long pointer -
capacity
private long capacity -
maxCapacity
private final long maxCapacity -
writeOffset
private long writeOffset -
nextResultOffset
private long nextResultOffset -
resultCount
private int resultCount -
generation
private int generation
-
-
Constructor Details
-
ByteBufferBuilder
public ByteBufferBuilder(int initialCapacity, long maxCapacity) -
ByteBufferBuilder
public ByteBufferBuilder(int initialCapacity)
-
-
Method Details
-
exactlySized
-
reserve
public long reserve(int size) -
ensureCapacity
private void ensureCapacity(long requiredCapacity) -
resize
private void resize(long newCapacity) -
build
-
clear
public void clear() -
discard
public void discard() -
isValid
private boolean isValid(int generation) -
freeResult
private void freeResult() -
discardResults
private void discardResults() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
checkOpen
private void checkOpen()
-