Package org.alfresco.util
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InputStreamContent(InputStream stream, String mimetype, String encoding)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContent()
Gets content as a stringString
getEncoding()
Gets the content encodingInputStream
getInputStream()
Gets the content input streamString
getMimetype()
Gets the content mimetypeReader
getReader()
Gets the content reader (which is sensitive to encoding)long
getSize()
Gets the content length (in bytes)
-
-
-
Constructor Detail
-
InputStreamContent
public InputStreamContent(InputStream stream, String mimetype, String encoding)
Constructor- Parameters:
stream
- content input streammimetype
- content mimetype
-
-
Method Detail
-
getContent
public String getContent() throws IOException
Description copied from interface:Content
Gets content as a string- Specified by:
getContent
in interfaceContent
- 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 interfaceContent
- 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 interfaceContent
- Returns:
- Reader
- Throws:
IOException
-
getSize
public long getSize()
Description copied from interface:Content
Gets the content length (in bytes)
-
getMimetype
public String getMimetype()
Description copied from interface:Content
Gets the content mimetype- Specified by:
getMimetype
in interfaceContent
- Returns:
- mimetype
-
getEncoding
public String getEncoding()
Description copied from interface:Content
Gets the content encoding- Specified by:
getEncoding
in interfaceContent
- Returns:
- encoding
-
-