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 StringgetContent()Gets content as a stringStringgetEncoding()Gets the content encodingInputStreamgetInputStream()Gets the content input streamStringgetMimetype()Gets the content mimetypeReadergetReader()Gets the content reader (which is sensitive to encoding)longgetSize()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:ContentGets content as a string- Specified by:
getContentin interfaceContent- Returns:
- content as a string
- Throws:
IOException
-
getInputStream
public InputStream getInputStream()
Description copied from interface:ContentGets the content input stream- Specified by:
getInputStreamin interfaceContent- Returns:
- input stream
-
getReader
public Reader getReader() throws IOException
Description copied from interface:ContentGets the content reader (which is sensitive to encoding)- Specified by:
getReaderin interfaceContent- Returns:
- Reader
- Throws:
IOException
-
getSize
public long getSize()
Description copied from interface:ContentGets the content length (in bytes)
-
getMimetype
public String getMimetype()
Description copied from interface:ContentGets the content mimetype- Specified by:
getMimetypein interfaceContent- Returns:
- mimetype
-
getEncoding
public String getEncoding()
Description copied from interface:ContentGets the content encoding- Specified by:
getEncodingin interfaceContent- Returns:
- encoding
-
-