Class GrizzlyResponse

java.lang.Object
com.ning.http.client.ResponseBase
com.ning.http.client.providers.grizzly.GrizzlyResponse
All Implemented Interfaces:
Response

public class GrizzlyResponse extends ResponseBase
HttpResponseBodyPart implementation using the Grizzly 2.0 HTTP client codec.
Since:
1.7.0
Author:
The Grizzly Team
  • Constructor Details

  • Method Details

    • getResponseBodyAsStream

      public InputStream getResponseBodyAsStream() throws IOException
      Description copied from interface: Response
      Returns an input stream for the response body. Note that you should not try to get this more than once, and that you should not close the stream.
      Returns:
      The input stream
      Throws:
      IOException
    • getResponseBodyExcerpt

      public String getResponseBodyExcerpt(int maxLength, String charset) throws IOException
      Description copied from interface: Response
      Returns the first maxLength bytes of the response body as a string. Note that this does not check whether the content type is actually a textual one, but it will use the charset if present in the content type header.
      Parameters:
      maxLength - The maximum number of bytes to read
      charset - the charset to use when decoding the stream
      Returns:
      The response body
      Throws:
      IOException
    • getResponseBody

      public String getResponseBody(String charset) throws IOException
      Description copied from interface: Response
      Return the entire response body as a String.
      Parameters:
      charset - the charset to use when decoding the stream
      Returns:
      the entire response body as a String.
      Throws:
      IOException
    • getResponseBodyExcerpt

      public String getResponseBodyExcerpt(int maxLength) throws IOException
      Description copied from interface: Response
      Returns the first maxLength bytes of the response body as a string. Note that this does not check whether the content type is actually a textual one, but it will use the charset if present in the content type header.
      Parameters:
      maxLength - The maximum number of bytes to read
      Returns:
      The response body
      Throws:
      IOException
    • getResponseBody

      public String getResponseBody() throws IOException
      Description copied from interface: Response
      Return the entire response body as a String.
      Returns:
      the entire response body as a String.
      Throws:
      IOException
    • getResponseBodyAsBytes

      public byte[] getResponseBodyAsBytes() throws IOException
      Description copied from interface: Response
      Return the entire response body as a byte[].
      Returns:
      the entire response body as a byte[].
      Throws:
      IOException
    • getResponseBodyAsByteBuffer

      public ByteBuffer getResponseBodyAsByteBuffer() throws IOException
      Description copied from interface: Response
      Return the entire response body as a ByteBuffer.
      Returns:
      the entire response body as a ByteBuffer.
      Throws:
      IOException
    • buildCookies

      protected List<Cookie> buildCookies()
      Specified by:
      buildCookies in class ResponseBase