Class BufferWriter<S>

java.lang.Object
com.jozufozu.flywheel.backend.struct.BufferWriter<S>
All Implemented Interfaces:
StructWriter<S>
Direct Known Subclasses:
UnsafeBufferWriter

public abstract class BufferWriter<S> extends Object implements StructWriter<S>
  • Field Details

    • backingBuffer

      protected final VecBuffer backingBuffer
    • stride

      protected final int stride
  • Constructor Details

  • Method Details

    • write

      public final void write(S struct)
      Description copied from interface: StructWriter
      Write the given struct to the backing array.
      Specified by:
      write in interface StructWriter<S>
    • advance

      protected abstract void advance()
      Advances the write pointer forward by the stride of one vertex. This will always be called after a struct is written, implementors need not call it themselves.
      See Also:
    • writeInternal

      protected abstract void writeInternal(S s)
    • seek

      public void seek(int pos)
      Description copied from interface: StructWriter
      Seek to the given position. The next write will occur there.
      Specified by:
      seek in interface StructWriter<S>