Package org.custommonkey.xmlunit
Class NodeInputStream
java.lang.Object
java.io.InputStream
org.custommonkey.xmlunit.NodeInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Adapter class to present the content of a DOM Node (e.g. a Document) as an
InputStream using a DOM to Stream transformation.
-
Constructor Summary
ConstructorDescriptionNodeInputStream
(Node rootNode) Simple constructorNodeInputStream
(Node rootNode, Properties outputProperties) Simple constructor -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
NodeInputStream
Simple constructor- Parameters:
rootNode
- the node to be presented as an input stream
-
NodeInputStream
Simple constructor- Parameters:
rootNode
- the node to be presented as an input streamoutputProperties
- properties to use during transformation
-
-
Method Details
-
read
InputStream method- Specified by:
read
in classInputStream
- Returns:
- byte as read
- Throws:
IOException
-
close
InputStream method Note that calling close allows a repeated read of the content- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
available
InputStream method- Overrides:
available
in classInputStream
- Returns:
- number of bytes available
- Throws:
IOException
-