Class SpdyHeaderBlockZlibDecoder

java.lang.Object

final class SpdyHeaderBlockZlibDecoder extends SpdyHeaderBlockRawDecoder
  • Field Details

    • DEFAULT_BUFFER_CAPACITY

      private static final int DEFAULT_BUFFER_CAPACITY
      See Also:
    • INVALID_HEADER_BLOCK

      private static final SpdyProtocolException INVALID_HEADER_BLOCK
    • MAX_DECOMPRESSED_SIZE_MULTIPLIER

      private static final int MAX_DECOMPRESSED_SIZE_MULTIPLIER
      See Also:
    • decompressor

      private final java.util.zip.Inflater decompressor
    • maxDecompressedSize

      private final long maxDecompressedSize
    • decompressed

      private ByteBuf decompressed
    • totalInflated

      private long totalInflated
  • Constructor Details

    • SpdyHeaderBlockZlibDecoder

      SpdyHeaderBlockZlibDecoder(SpdyVersion spdyVersion, int maxHeaderSize)
  • Method Details

    • calculateMaxDecompressedSizePerBlock

      static long calculateMaxDecompressedSizePerBlock(int maxHeaderSize)
    • decode

      void decode(ByteBufAllocator alloc, ByteBuf headerBlock, SpdyHeadersFrame frame) throws java.lang.Exception
      Description copied from class: SpdyHeaderBlockDecoder
      Decodes a SPDY Header Block, adding the Name/Value pairs to the given Headers frame. If the header block is malformed, the Headers frame will be marked as invalid. A stream error with status code PROTOCOL_ERROR must be issued in response to an invalid frame.
      Overrides:
      decode in class SpdyHeaderBlockRawDecoder
      Parameters:
      alloc - the ByteBufAllocator which can be used to allocate new ByteBufs
      headerBlock - the HeaderBlock to decode
      frame - the Headers frame that receives the Name/Value pairs
      Throws:
      java.lang.Exception - If the header block is malformed in a way that prevents any future decoding of any other header blocks, an exception will be thrown. A session error with status code PROTOCOL_ERROR must be issued.
    • setInput

      private int setInput(ByteBuf compressed)
    • decompress

      private int decompress(ByteBufAllocator alloc, SpdyHeadersFrame frame) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • ensureBuffer

      private void ensureBuffer(ByteBufAllocator alloc)
    • endHeaderBlock

      void endHeaderBlock(SpdyHeadersFrame frame) throws java.lang.Exception
      Overrides:
      endHeaderBlock in class SpdyHeaderBlockRawDecoder
      Throws:
      java.lang.Exception
    • end

      public void end()
      Overrides:
      end in class SpdyHeaderBlockRawDecoder
    • releaseBuffer

      private void releaseBuffer()