Package com.mojang.blaze3d.vertex
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 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 long(package private) longprivate intprivate long -
Constructor Summary
ConstructorsConstructorDescriptionByteBufferBuilder(int pCapacity) ByteBufferBuilder(int pCapacity, long pMaxCapacity) -
Method Summary
Modifier and TypeMethodDescriptionbuild()private voidvoidclear()voidclose()voiddiscard()private voidprivate voidensureCapacity(long pCapacity) static ByteBufferBuilderexactlySized(int pSize) (package private) void(package private) booleanisValid(int pGeneration) longreserve(int pBytes) private voidresize(long pNewSize)
-
Field Details
-
MEMORY_POOL
private static final com.mojang.jtracy.MemoryPool MEMORY_POOL -
LOGGER
private static final org.slf4j.Logger LOGGER -
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
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 pCapacity, long pMaxCapacity) -
ByteBufferBuilder
public ByteBufferBuilder(int pCapacity)
-
-
Method Details
-
exactlySized
-
reserve
public long reserve(int pBytes) -
ensureCapacity
private void ensureCapacity(long pCapacity) -
resize
private void resize(long pNewSize) -
build
-
clear
public void clear() -
discard
public void discard() -
isValid
boolean isValid(int pGeneration) -
freeResult
void freeResult() -
discardResults
private void discardResults() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
checkOpen
private void checkOpen()
-