@Deprecated
public interface DataSink
Actually, the DataSink can be seen as a factory for creating OutputStreams with mime type and character encoding provided. This allows the API user to decide how data is to be stored (e.g. in a file, in a byte array, etc.).
Modifier and Type | Method and Description |
---|---|
java.io.OutputStream |
createOutputStream(java.lang.String mimeType)
Deprecated.
Creates an OutputStream for binary data.
|
java.io.OutputStream |
createOutputStream(java.lang.String mimeType,
java.lang.String characterEncoding)
Deprecated.
Creates an OutputStream for character data.
|
java.lang.String |
getCharacterEncoding()
Deprecated.
Returns the character encoding of the data stream.
|
java.lang.String |
getMimeType()
Deprecated.
Returns the mime type of the data stream.
|
java.io.OutputStream createOutputStream(java.lang.String mimeType) throws java.io.IOException
Note that the stream may be written only once. Creating another stream overwrites the existing one.
mimeType
- The mime type of the output data.java.io.IOException
- Thrown if the stream cannot be created.java.io.OutputStream createOutputStream(java.lang.String mimeType, java.lang.String characterEncoding) throws java.io.IOException
This is basically the same as createOutputStream(String)
, but
allows to specify the character encoding.
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.java.lang.String getMimeType()
This is only valid after a stream has been created.
java.lang.String getCharacterEncoding()
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).