Package org.opencms.util
Class CmsByteArrayDataSource
java.lang.Object
org.opencms.util.CmsByteArrayDataSource
- All Implemented Interfaces:
javax.activation.DataSource
A DataSource backed by a byte array. The byte array may be passed in directly, or may be initialized from an InputStream or a String.
- Since:
- 6.3.0
-
Constructor Summary
ConstructorDescriptionCmsByteArrayDataSource
(String name, byte[] data, String contentType) Creates a ByteArrayDataSource with data from the specified byte array and with the specified MIME type. -
Method Summary
-
Constructor Details
-
CmsByteArrayDataSource
Creates a ByteArrayDataSource with data from the specified byte array and with the specified MIME type.- Parameters:
name
- the name of the datadata
- the datacontentType
- the MIME content type of the data
-
-
Method Details
-
getContentType
- Specified by:
getContentType
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getContentType()
-
getInputStream
- Specified by:
getInputStream
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getInputStream()
-
getName
- Specified by:
getName
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getName()
-
getOutputStream
- Specified by:
getOutputStream
in interfacejavax.activation.DataSource
- Throws:
IOException
- See Also:
-
DataSource.getOutputStream()
-