|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectat.gv.egiz.pdfas.io.ByteArrayDataSink
| Field Summary | |
protected String |
characterEncoding
The character encoding. |
protected String |
mimeType
The mime type. |
| Constructor Summary | |
ByteArrayDataSink()
|
|
| Method Summary | |
OutputStream |
createOutputStream(String mimeType)
Creates an OutputStream for binary data. |
OutputStream |
createOutputStream(String mimeType,
String characterEncoding)
Creates an OutputStream for character data. |
String |
getCharacterEncoding()
Returns the character encoding of the data stream. |
byte[] |
getData()
Returns the byte data, or null if none available. |
String |
getMimeType()
Returns the mime type of the data stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected String mimeType
protected String characterEncoding
| Constructor Detail |
public ByteArrayDataSink()
| Method Detail |
public OutputStream createOutputStream(String mimeType)
throws IOException
DataSinkNote that the stream may be written only once. Creating another stream overwrites the existing one.
createOutputStream in interface DataSinkmimeType - The mime type of the output data.
IOException - Thrown if the stream cannot be created.DataSink.createOutputStream(java.lang.String)
public OutputStream createOutputStream(String mimeType,
String characterEncoding)
throws IOException
DataSink
This is basically the same as DataSink.createOutputStream(String), but
allows to specify the character encoding.
createOutputStream in interface DataSinkmimeType - The mime type of the output data.characterEncoding - The character encoding of the data.
IOException - Thrown if the stream cannot be created.DataSink.createOutputStream(java.lang.String,
java.lang.String)public String getMimeType()
DataSinkThis is only valid after a stream has been created.
getMimeType in interface DataSinkDataSink.getMimeType()public String getCharacterEncoding()
DataSinkThis 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 DataSinkDataSink.getCharacterEncoding()public byte[] getData()
Note that internally, this just calls the ByteArrayOutputStream.toByteArray() method.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||