Class NBitIntegerEncoder

java.lang.Object
org.eclipse.jetty.http.compression.NBitIntegerEncoder

public class NBitIntegerEncoder extends Object
Used to encode integers as described in RFC7541.
  • Method Details

    • octetsNeeded

      public static int octetsNeeded(int prefix, long value)
      Parameters:
      prefix - the prefix used to encode this long.
      value - the integer to encode.
      Returns:
      the number of octets it would take to encode the long.
    • encode

      public static void encode(ByteBuffer buffer, int prefix, long value)
      Parameters:
      buffer - the buffer to encode into.
      prefix - the prefix used to encode this long.
      value - the long to encode into the buffer.