Interface Body

    • Method Detail

      • length

        Integer length()
        length in bytes, if known. Null if not.


        Note
        This is an integer as most implementations cannot do bodies greater than 2GB. Moreover, the scope of this interface doesn't include large bodies.
        Returns:
        Length of the body
      • isRepeatable

        boolean isRepeatable()
        True if asInputStream() and asReader() can be called more than once.
        Returns:
        True if repeatable
      • asInputStream

        InputStream asInputStream()
                           throws IOException
        It is the responsibility of the caller to close the stream.
        Returns:
        Stream representation
        Throws:
        IOException - Error generating Stream
      • asReader

        Reader asReader()
                 throws IOException
        It is the responsibility of the caller to close the stream.
        Returns:
        Reader representation
        Throws:
        IOException - Error generating Reader
      • asString

        String asString()
                 throws IOException
        Returns body as string and closes the stream.
        Returns:
        String representation
        Throws:
        IOException - Error generating String