Package org.custommonkey.xmlunit
Class NodeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.custommonkey.xmlunit.NodeInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class NodeInputStream extends InputStream
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
Constructors Constructor Description NodeInputStream(Node rootNode)Simple constructorNodeInputStream(Node rootNode, Properties outputProperties)Simple constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()InputStream methodvoidclose()InputStream method Note that calling close allows a repeated read of the contentintread()InputStream method-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
NodeInputStream
public NodeInputStream(Node rootNode)
Simple constructor- Parameters:
rootNode- the node to be presented as an input stream
-
NodeInputStream
public NodeInputStream(Node rootNode, Properties outputProperties)
Simple constructor- Parameters:
rootNode- the node to be presented as an input streamoutputProperties- properties to use during transformation
-
-
Method Detail
-
read
public int read() throws IOExceptionInputStream method- Specified by:
readin classInputStream- Returns:
- byte as read
- Throws:
IOException
-
close
public void close() throws IOExceptionInputStream method Note that calling close allows a repeated read of the content- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
available
public int available() throws IOExceptionInputStream method- Overrides:
availablein classInputStream- Returns:
- number of bytes available
- Throws:
IOException
-
-