public class NodeInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private int |
atPos |
private java.io.ByteArrayOutputStream |
nodeContentBytes |
private java.util.Properties |
outputProperties |
private org.w3c.dom.Node |
rootNode |
Constructor and Description |
---|
NodeInputStream(org.w3c.dom.Node rootNode)
Simple constructor
|
NodeInputStream(org.w3c.dom.Node rootNode,
java.util.Properties outputProperties)
Simple constructor
|
Modifier and Type | Method and Description |
---|---|
int |
available()
InputStream method
|
void |
close()
InputStream method
Note that calling close allows a repeated read of the content
|
private void |
ensureContentAvailable()
Do the actual work of serializing the node to bytes
|
int |
read()
InputStream method
|
private int |
reallyAvailable() |
private final org.w3c.dom.Node rootNode
private final java.io.ByteArrayOutputStream nodeContentBytes
private final java.util.Properties outputProperties
private int atPos
public NodeInputStream(org.w3c.dom.Node rootNode)
rootNode
- the node to be presented as an input streampublic NodeInputStream(org.w3c.dom.Node rootNode, java.util.Properties outputProperties)
rootNode
- the node to be presented as an input streamprivate void ensureContentAvailable() throws java.io.IOException
java.io.IOException
- if serialization goes awrypublic int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
private int reallyAvailable()