java.lang.Object
tools.jackson.dataformat.protobuf.ByteAccumulator

public class ByteAccumulator extends Object
Helper object used for buffering content for cases where we need (byte-)length prefixes for content like packed arrays, embedded messages, Strings and (perhaps) binary content.
  • Field Details

    • _parent

      protected final ByteAccumulator _parent
    • _prefixBuffer

      protected final byte[] _prefixBuffer
      Caller-provided buffer in which optional type prefix, and mandatory length indicator may be added. Caller ensures there is enough room for both, i.e. up to 10 bytes (if both) or 5 bytes (if just length)
    • _prefixOffset

      protected final int _prefixOffset
      Offset within _prefixBuffer where there is room for encoding prefix (type, tag, length).
    • _typedTag

      protected final int _typedTag
    • _firstSegment

      protected tools.jackson.dataformat.protobuf.ByteAccumulator.Segment _firstSegment
    • _lastSegment

      protected tools.jackson.dataformat.protobuf.ByteAccumulator.Segment _lastSegment
    • _segmentBytes

      protected int _segmentBytes
      Total number of bytes contained within buffers, to be used for length prefix.
    • _parentStart

      protected int _parentStart
      Pointer to start of contents provided by parent, preceding room for prefix (that is, same as or less than `_prefixOffset`)
  • Constructor Details

    • ByteAccumulator

      public ByteAccumulator(ByteAccumulator p, int typedTag, byte[] prefixBuffer, int prefixOffset, int parentStart)
  • Method Details