Class ByteBufferBuilder

java.lang.Object
com.mojang.blaze3d.vertex.ByteBufferBuilder
All Implemented Interfaces:
AutoCloseable

public class ByteBufferBuilder extends Object implements AutoCloseable
  • 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

      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

      public static ByteBufferBuilder exactlySized(int pSize)
    • reserve

      public long reserve(int pBytes)
    • ensureCapacity

      private void ensureCapacity(long pCapacity)
    • resize

      private void resize(long pNewSize)
    • build

      @Nullable public ByteBufferBuilder.Result 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:
      close in interface AutoCloseable
    • checkOpen

      private void checkOpen()