Package hudson.plugins.nunit
Class InvalidXmlStreamReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- hudson.plugins.nunit.InvalidXmlStreamReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class InvalidXmlStreamReader extends FilterReader
Provides similar functionality to org.apache.commons.io.input.XmlStreamReader plus replacing invalid xml characters.
-
-
Field Summary
-
Fields inherited from class java.io.FilterReader
in
-
-
Constructor Summary
Constructors Constructor Description InvalidXmlStreamReader(InputStream in, char replacement)
Constructs a new reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
Invokes the in'sread()
method, detecting and skipping invalid xml charactersint
read(char[] cbuf, int off, int len)
Invokes the in'sread(byte[], int, int)
method, detecting and skipping invalid xml.-
Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skip
-
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
-
-
-
Constructor Detail
-
InvalidXmlStreamReader
public InvalidXmlStreamReader(InputStream in, char replacement) throws IOException
Constructs a new reader.- Parameters:
in
- the underlying stream.replacement
- the replacement character for invalid xml characters.- Throws:
IOException
-
-
Method Detail
-
read
public int read() throws IOException
Invokes the in'sread()
method, detecting and skipping invalid xml characters- Overrides:
read
in classFilterReader
- Returns:
- the character read (excluding invalid xml characters) or -1 if the end of stream
- Throws:
IOException
- if an I/O error occurs
-
read
public int read(char[] cbuf, int off, int len) throws IOException
Invokes the in'sread(byte[], int, int)
method, detecting and skipping invalid xml.- Overrides:
read
in classFilterReader
- Parameters:
cbuf
- the buffer to read the characters intooff
- The start offsetlen
- The maximum number of characters to read- Returns:
- the number of characters read or -1 if the end of stream
- Throws:
IOException
- if an I/O error occurs
-
-