DEFAULT_CHARACTER_SET_ENCODING
Constructor and Description |
---|
StringSource(String str) |
StringSource(String str, String contentType) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes(int len) |
String |
getCharset() |
String |
getContentType() |
InputStream |
getInputStream(TransformOptions options)
Returns streaming byte-baseed representation of the Source's content.
|
static StringSource |
getInstance(InputStream in, TransformOptions options) |
int |
getSize() |
String |
getString() |
String |
toString() |
void |
writeTo(OutputStream os, TransformOptions options)
Serializes the Source's content to a byte-based stream.
|
public StringSource(String str)
public String getContentType()
public String getString()
public InputStream getInputStream(TransformOptions options) throws IOException, TransformException
Source
getInputStream
in interface Source
options
- Options used to affect the serializationIOException
TransformException
public void writeTo(OutputStream os, TransformOptions options) throws IOException, TransformException
Source
Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
writeTo
in interface Source
os
- the OutputStream to which serialized content will be writtenoptions
- TransformOptions used to affect the serializationIOException
TransformException
public static StringSource getInstance(InputStream in, TransformOptions options) throws IOException
IOException
public byte[] getBytes(int len)
public int getSize()
public String getCharset()