public class DoctypeInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private java.io.ByteArrayOutputStream |
baos |
private DoctypeSupport |
support |
private java.io.InputStream |
wrappedStream |
Constructor and Description |
---|
DoctypeInputStream(java.io.InputStream originalSource,
java.lang.String encoding,
java.lang.String doctypeName,
java.lang.String systemID)
Create an InputStream whose XML content is provided by the
originalSource with the exception of the DOCTYPE which is
provided by the doctypeName and systemID.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected java.lang.String |
getContent(java.lang.String encoding) |
int |
read()
Read DOCTYPE-replaced content from the wrapped InputStream
|
private final java.io.ByteArrayOutputStream baos
private final java.io.InputStream wrappedStream
private final DoctypeSupport support
public DoctypeInputStream(java.io.InputStream originalSource, java.lang.String encoding, java.lang.String doctypeName, java.lang.String systemID)
originalSource
- doctypeName
- systemID
- protected java.lang.String getContent(java.lang.String encoding) throws java.io.IOException
java.io.IOException
- if thrown while reading from the original sourcepublic 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