public class StreamSource extends java.lang.Object implements SingleUseSource
writeTo() method will result in all data being consumed immediately, assuming no error occurs. The pull-based getInputStream() actually gives the underlying InputStream directly to the caller.DEFAULT_CHARACTER_SET_ENCODING| Constructor and Description |
|---|
StreamSource(java.io.InputStream inputStream) |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getInputStream(TransformOptions options)
Returns streaming byte-baseed representation of the Source's content.
|
boolean |
isConsumed()
Indicates if the Source has already been consumed
|
int |
peek(byte[] b, int off, int len)
Peek bytes from the input stream without consuming the input stream.
|
void |
writeTo(java.io.OutputStream out, TransformOptions options)
Serializes the Source's content to a byte-based stream.
|
public StreamSource(java.io.InputStream inputStream)
inputStream - A valid InputStream reference to an XML stream.public java.io.InputStream getInputStream(TransformOptions options)
SourcegetInputStream in interface Sourceoptions - Options used to affect the serialization
public void writeTo(java.io.OutputStream out,
TransformOptions options)
throws java.io.IOException
SourceNote that this method may involve an internal transformation, although it should not in any way change the underlying content.
public boolean isConsumed()
SingleUseSourceisConsumed in interface SingleUseSource
public int peek(byte[] b,
int off,
int len)
throws java.io.IOException
readb - bytes array to copy bytes tooff - start offset for bytes to copylen - length of bytes to copyjava.io.IOException - an I/O Exception occurred