Class HpackDynamicTable

java.lang.Object
io.netty.handler.codec.http2.HpackDynamicTable

final class HpackDynamicTable extends java.lang.Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private long
     
    (package private) int
     
    (package private) HpackHeaderField[]
     
    private long
     
    (package private) int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    HpackDynamicTable(long initialCapacity)
    Creates a new dynamic table with the specified initial capacity.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add the header field to the dynamic table.
    long
    Return the maximum allowable size of the dynamic table.
    void
    Remove all entries from the dynamic table.
    getEntry(int index)
    Return the header field at the given index.
    int
    Return the number of header fields in the dynamic table.
    Remove and return the oldest header field from the dynamic table.
    void
    setCapacity(long capacity)
    Set the maximum size of the dynamic table.
    long
    Return the current size of the dynamic table.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • hpackHeaderFields

      HpackHeaderField[] hpackHeaderFields
    • tail

      int tail
    • size

      private long size
    • capacity

      private long capacity
  • Constructor Details

    • HpackDynamicTable

      HpackDynamicTable(long initialCapacity)
      Creates a new dynamic table with the specified initial capacity.
  • Method Details

    • length

      public int length()
      Return the number of header fields in the dynamic table.
    • size

      public long size()
      Return the current size of the dynamic table. This is the sum of the size of the entries.
    • capacity

      public long capacity()
      Return the maximum allowable size of the dynamic table.
    • getEntry

      public HpackHeaderField getEntry(int index)
      Return the header field at the given index. The first and newest entry is always at index 1, and the oldest entry is at the index length().
    • add

      public void add(HpackHeaderField header)
      Add the header field to the dynamic table. Entries are evicted from the dynamic table until the size of the table and the new header field is less than or equal to the table's capacity. If the size of the new entry is larger than the table's capacity, the dynamic table will be cleared.
    • remove

      public HpackHeaderField remove()
      Remove and return the oldest header field from the dynamic table.
    • clear

      public void clear()
      Remove all entries from the dynamic table.
    • setCapacity

      public void setCapacity(long capacity)
      Set the maximum size of the dynamic table. Entries are evicted from the dynamic table until the size of the table is less than or equal to the maximum size.