Class InputStreamContent

java.lang.Object
org.alfresco.util.InputStreamContent
All Implemented Interfaces:
Serializable, Content

public class InputStreamContent extends Object implements Content, Serializable
Input Stream based Content
See Also:
  • Constructor Details

    • InputStreamContent

      public InputStreamContent(InputStream stream, String mimetype, String encoding)
      Constructor
      Parameters:
      stream - content input stream
      mimetype - content mimetype
  • Method Details

    • getContent

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

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

      public Reader getReader() throws IOException
      Description copied from interface: Content
      Gets the content reader (which is sensitive to encoding)
      Specified by:
      getReader in interface Content
      Returns:
      Reader
      Throws:
      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 String getMimetype()
      Description copied from interface: Content
      Gets the content mimetype
      Specified by:
      getMimetype in interface Content
      Returns:
      mimetype
    • getEncoding

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