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.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionprivate int reallyAvailable()