Class FixedLengthTransferEncoding

    • Constructor Detail

      • FixedLengthTransferEncoding

        public FixedLengthTransferEncoding()
    • Method Detail

      • wantDecode

        public boolean wantDecode​(HttpHeader httpPacket)
        Return true if this encoding should be used to parse the content of the passed HttpHeader, or false otherwise.
        Specified by:
        wantDecode in interface TransferEncoding
        Parameters:
        httpPacket - HttpHeader.
        Returns:
        true if this encoding should be used to parse the content of the passed HttpHeader, or false otherwise.
      • wantEncode

        public boolean wantEncode​(HttpHeader httpPacket)
        Return true if this encoding should be used to serialize the content of the passed HttpHeader, or false otherwise.
        Specified by:
        wantEncode in interface TransferEncoding
        Parameters:
        httpPacket - HttpHeader.
        Returns:
        true if this encoding should be used to serialize the content of the passed HttpHeader, or false otherwise.
      • prepareSerialize

        public void prepareSerialize​(org.glassfish.grizzly.filterchain.FilterChainContext ctx,
                                     HttpHeader httpHeader,
                                     HttpContent httpContent)
        Description copied from interface: TransferEncoding
        This method will be called by HttpCodecFilter to let TransferEncoding prepare itself for the content serialization. At this time TransferEncoding is able to change, update HTTP packet headers.
        Specified by:
        prepareSerialize in interface TransferEncoding
        Parameters:
        ctx - FilterChainContext
        httpHeader - HTTP packet headers.
        httpContent - ready HTTP content (might be null).
      • parsePacket

        public ParsingResult parsePacket​(org.glassfish.grizzly.filterchain.FilterChainContext ctx,
                                         HttpHeader httpPacket,
                                         org.glassfish.grizzly.Buffer input)
        Parse HTTP packet payload, represented by Buffer using specific transfer encoding.
        Specified by:
        parsePacket in interface TransferEncoding
        Parameters:
        ctx - FilterChainContext
        httpPacket - HttpHeader with parsed headers.
        input - Buffer HTTP message payload.
        Returns:
        ParsingResult