Interface TransferEncoding

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getId()
      Returns the supported encoding id.
      java.io.InputStream open​(HttpRequest request, java.io.InputStream input)
      Opens an InputStream that can be used to decode message body of the given request.
      java.io.OutputStream open​(HttpResponse response, java.io.OutputStream output)
      Opens an OutputStream that can be used to encode the message body of the HttpResponse.
    • Method Detail

      • getId

        java.lang.String getId()
        Returns the supported encoding id.
        Returns:
        an internal String in lower case format.
      • open

        java.io.InputStream open​(HttpRequest request,
                                 java.io.InputStream input)
                          throws java.io.IOException
        Opens an InputStream that can be used to decode message body of the given request. The returned InputStream MUST conforms to the followings:
        • The InputStream MUST reach the EOF (i.e. read methods returns -1) when the request body has been completely read.
        • The InputStream.close() method MUST read any remaining bytes from the message body (if any) and MUST NOT close the underlying stream.
        Parameters:
        request - the HttpRequest to be decoded by this transfer coding handler.
        input - the InputStream from which encoded message body can be read.
        Returns:
        the InputStream used to decode message body of the given request.
        Throws:
        java.io.IOException - if any I/O Error occurs.
      • open

        java.io.OutputStream open​(HttpResponse response,
                                  java.io.OutputStream output)
                           throws java.io.IOException
        Opens an OutputStream that can be used to encode the message body of the HttpResponse.
        Parameters:
        response - the HttpResponse to be encoded by this transfer coding handler.
        output - the OutputStream where the encoded message body is written.
        Returns:
        the output stream used to encode message body of the given response.
        Throws:
        java.io.IOException - if any I/O Error occurs.