Class HttpPipelineResponse

    • Constructor Detail

      • HttpPipelineResponse

        public HttpPipelineResponse​(int mainBufferSize,
                                    int bufferSize)
    • Method Detail

      • isFirstRead

        public final boolean isFirstRead()
        Verify if the first read over the pipeline.
        Returns:
        Returns true if the first read operation and false in the otherwise.
      • getReadCounter

        public final int getReadCounter()
        Returns the counter of the read operations over pipeline.
        Returns:
        Counter of the read operations.
      • read

        public final int read()
        This method reads the bytes of the application side of the pipeline and wrap this bytes depends of the result encoding.
        Returns:
        Buffer with all the read bytes if the buffer size is equals to -1 then this pipeline is done.
      • getMainBuffer

        public final java.nio.ByteBuffer getMainBuffer()
        Return the buffer, this method must be call before the read method.
        Returns:
        Main buffer with all the read bytes.
      • wrap

        protected int wrap​(java.nio.ByteBuffer result,
                           HttpPipelineResponse.StreamingPackage streamingPackage,
                           int size)
        This method wrap the byte with the encoding protocol.
        Parameters:
        result - In this instance of the byte buffer, this method must put the byte to wrap the source data and the source data.
        streamingPackage - All the bytes read from the application source.
        size - Size of the buffer used to read the application source.
        Returns:
        Byte array wrapped.
      • onStart

        public void onStart()
        This method is called before the fir read over the pipeline.
      • onEnd

        public void onEnd()
        This method is called after the last read over the pipeline.
      • readPipeline

        protected abstract int readPipeline​(HttpPipelineResponse.StreamingPackage streamingPackage)
        This method must implements the way to read the information from the application source.
        Parameters:
        streamingPackage - Buffer to put all the read bytes.
        Returns:
        Number of bytes read.