Constructor and Description |
---|
ByteArrayDataSink_OLD() |
Modifier and Type | Method and Description |
---|---|
java.io.OutputStream |
createOutputStream(java.lang.String mimeType)
Creates an OutputStream for binary data.
|
java.io.OutputStream |
createOutputStream(java.lang.String mimeType,
java.lang.String characterEncoding)
Creates an OutputStream for character data.
|
java.io.ByteArrayOutputStream |
getBAOS() |
java.lang.String |
getCharacterEncoding()
Returns the character encoding of the data stream.
|
java.lang.String |
getMimeType()
Returns the mime type of the data stream.
|
public java.io.ByteArrayOutputStream getBAOS()
public java.io.OutputStream createOutputStream(java.lang.String mimeType) throws java.io.IOException
DataSink
Note that the stream may be written only once. Creating another stream overwrites the existing one.
createOutputStream
in interface DataSink
mimeType
- The mime type of the output data.java.io.IOException
- Thrown if the stream cannot be created.public java.io.OutputStream createOutputStream(java.lang.String mimeType, java.lang.String characterEncoding) throws java.io.IOException
DataSink
This is basically the same as DataSink.createOutputStream(String)
, but
allows to specify the character encoding.
createOutputStream
in interface DataSink
mimeType
- The mime type of the output data.characterEncoding
- The character encoding of the data.java.io.IOException
- Thrown if the stream cannot be created.public java.lang.String getMimeType()
DataSink
This is only valid after a stream has been created.
getMimeType
in interface DataSink
public java.lang.String getCharacterEncoding()
DataSink
This is only valid after a stream has been created. Null means that no character encoding was specified for the data (e.g. if the data is binary).
getCharacterEncoding
in interface DataSink