Class BinaryHeaderMap

  • All Implemented Interfaces:
    Recyclable, java.lang.Iterable<BinaryHeaderMap.Entry>

    public class BinaryHeaderMap
    extends java.lang.Object
    implements Recyclable, java.lang.Iterable<BinaryHeaderMap.Entry>
    A map (not implementing the java.util.Map interface) that only supports String-byte[] pair additions and iterations. The map doesn't allocate during addition or iteration. This map does not support any form of concurrency. It can be either be in a write mode (through its add(java.lang.String, byte[]) method) or read mode (through the iterator() API) at a given time. Reads and writes must not be performed by more than one thread concurrently.

    NOTE: this map does not guarantee visibility, therefore ensuring visibility when switching from read to write mode (or the other way around) is under the responsibility of the map's user.

    • Field Detail

      • MAXIMUM_HEADER_BUFFER_SIZE

        public static final int MAXIMUM_HEADER_BUFFER_SIZE
        See Also:
        Constant Field Values
    • Constructor Detail

      • BinaryHeaderMap

        public BinaryHeaderMap()
    • Method Detail

      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • add

        public boolean add​(java.lang.String key,
                           byte[] value)
      • resetState

        public void resetState()
        Description copied from interface: Recyclable
        resets pooled object state so it can be reused
        Specified by:
        resetState in interface Recyclable