Class InputStreamContent

  • All Implemented Interfaces:
    java.io.Serializable, Content

    public class InputStreamContent
    extends java.lang.Object
    implements Content, java.io.Serializable
    Input Stream based Content
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      InputStreamContent​(java.io.InputStream stream, java.lang.String mimetype, java.lang.String encoding)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContent()
      Gets content as a string
      java.lang.String getEncoding()
      Gets the content encoding
      java.io.InputStream getInputStream()
      Gets the content input stream
      java.lang.String getMimetype()
      Gets the content mimetype
      java.io.Reader getReader()
      Gets the content reader (which is sensitive to encoding)
      long getSize()
      Gets the content length (in bytes)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InputStreamContent

        public InputStreamContent​(java.io.InputStream stream,
                                  java.lang.String mimetype,
                                  java.lang.String encoding)
        Constructor
        Parameters:
        stream - content input stream
        mimetype - content mimetype
    • Method Detail

      • getContent

        public java.lang.String getContent()
                                    throws java.io.IOException
        Description copied from interface: Content
        Gets content as a string
        Specified by:
        getContent in interface Content
        Returns:
        content as a string
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.InputStream getInputStream()
        Description copied from interface: Content
        Gets the content input stream
        Specified by:
        getInputStream in interface Content
        Returns:
        input stream
      • getReader

        public java.io.Reader getReader()
                                 throws java.io.IOException
        Description copied from interface: Content
        Gets the content reader (which is sensitive to encoding)
        Specified by:
        getReader in interface Content
        Returns:
        Reader
        Throws:
        java.io.IOException
      • getSize

        public long getSize()
        Description copied from interface: Content
        Gets the content length (in bytes)
        Specified by:
        getSize in interface Content
        Returns:
        length
      • getMimetype

        public java.lang.String getMimetype()
        Description copied from interface: Content
        Gets the content mimetype
        Specified by:
        getMimetype in interface Content
        Returns:
        mimetype
      • getEncoding

        public java.lang.String getEncoding()
        Description copied from interface: Content
        Gets the content encoding
        Specified by:
        getEncoding in interface Content
        Returns:
        encoding