Class TagWriterImpl.HeapByteBufferEncoder

Enclosing class:
TagWriterImpl

private static final class TagWriterImpl.HeapByteBufferEncoder extends TagWriterImpl.ByteArrayEncoder
Writes directly to the underlying array of a heap ByteBuffer because is faster than the put() operation. Buffer position is not updated after every write, just on flush.
  • Field Details

    • buffer

      private final ByteBuffer buffer
    • startPos

      private final int startPos
  • Constructor Details

    • HeapByteBufferEncoder

      private HeapByteBufferEncoder(ByteBuffer buffer)
  • Method Details

    • flush

      void flush()
      Description copied from class: TagWriterImpl.Encoder
      Commits the witten bytes after several write operations were performed. Updates counters, positions, whatever.
      Overrides:
      flush in class TagWriterImpl.Encoder