public class DoctypeReader extends Reader
Adapts the marked-up content in a source Reader to specify that it conforms to a different DTD. Combines Reader semantics with the ability to specify a target doctype for a character stream containing XML markup. Used by Validator class to wrap a Reader when performing validation of a document against a DTD.
DoctypeReaderCreate a Reader whose XML content is provided by the originalSource with the exception of the DOCTYPE which is provided by the doctypeName and systemID.
originalSource- the original input
doctypeName- name of the new doctype
systemID- system id of the new doctype
- the content of the original source, without amendments or substitutions. Safe to call multiple times.
IOException- if thrown while reading from the original source
readpublic int read
(char cbuf, int off, int len) throws IOExceptionRead DOCTYPE-replaced content from the wrapped Reader
readpublic int read() throws IOExceptionRead DOCTYPE-replaced content from the wrapped Reader
closepublic void close() throws IOException