Package nu.validator.htmlparser.io
Class HtmlInputStreamReader
java.lang.Object
java.io.Reader
nu.validator.htmlparser.io.HtmlInputStreamReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
,ByteReadable
,Locator
Be very careful with this class. It is not a general-purpose subclass of of
Reader
. Instead, it is the minimal implementation that does
what Tokenizer
needs while being an instance of
Reader
.
The only reason why this is a public class is that it needs to be visible to
test code in another package.- Version:
- $Id$
- Author:
- hsivonen
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHtmlInputStreamReader
(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Heuristics heuristics) HtmlInputStreamReader
(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Encoding encoding) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
int
static void
int
read()
int
read
(char[] charArray) int
read
(char[] cbuf, int off, int len) int
read
(CharBuffer target) int
readByte()
Returns the value of the next byte as an integer from 0 to 0xFF or -1 if the stream has ended.void
switchEncoding
(Encoding newEnc) Methods inherited from class java.io.Reader
mark, markSupported, nullReader, ready, reset, skip, transferTo
-
Constructor Details
-
HtmlInputStreamReader
public HtmlInputStreamReader(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Heuristics heuristics) throws SAXException, IOException - Parameters:
inputStream
-errorHandler
-locator
-- Throws:
IOException
SAXException
-
HtmlInputStreamReader
public HtmlInputStreamReader(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Encoding encoding) throws SAXException, IOException - Throws:
SAXException
IOException
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
readByte
Description copied from interface:ByteReadable
Returns the value of the next byte as an integer from 0 to 0xFF or -1 if the stream has ended.- Specified by:
readByte
in interfaceByteReadable
- Returns:
- integer from 0 to 0xFF or -1 on EOF
- Throws:
IOException
-
main
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumber
in interfaceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceLocator
-
getPublicId
- Specified by:
getPublicId
in interfaceLocator
-
getSystemId
- Specified by:
getSystemId
in interfaceLocator
-
getCharset
-
read
- Overrides:
read
in classReader
- Throws:
IOException
- See Also:
-
read
- Specified by:
read
in classReader
- Throws:
IOException
- See Also:
-
read
- Specified by:
read
in interfaceReadable
- Overrides:
read
in classReader
- Throws:
IOException
- See Also:
-
switchEncoding
-