Class HttpPackage.ChunkedDecoderLayer

    • Constructor Detail

      • ChunkedDecoderLayer

        public ChunkedDecoderLayer()
    • Method Detail

      • add

        public void add​(java.nio.ByteBuffer bodyFragment)
        Adds a fragment of the body into the internal buffer.
        Specified by:
        add in interface HttpPackage.TransferDecodingLayerInterface
        Parameters:
        bodyFragment - Body fragment.
      • done

        public boolean done​(HttpPackage httpPackage)
        Verify if the body is complete. The body is complete when the chunked size into the fragment is zero. * @param httpPackage Package to verify if the body is complete. For this particular implementation this param is unuseful.
        Specified by:
        done in interface HttpPackage.TransferDecodingLayerInterface
        Parameters:
        httpPackage - Package to verify if the body is complete.
        Returns:
        True if the body is complete and false in the otherwise
      • getBody

        public byte[] getBody()
        Returns the accumulated body, if the body is complete then this accumulated body is the complete body.
        Specified by:
        getBody in interface HttpPackage.TransferDecodingLayerInterface
        Returns:
        Accumulated body.