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,Locator2,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, Heuristics heuristics, int sniffingLimit) HtmlInputStreamReader(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Encoding encoding) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intintstatic voidintread()intread(char[] charArray) intread(char[] cbuf, int off, int len) intread(CharBuffer target) intreadByte()Returns the value of the next byte as an integer from 0 to 0xFF or -1 if the stream has ended.voidswitchEncoding(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, int sniffingLimit) throws SAXException, IOException - Parameters:
inputStream-errorHandler-tokenizer-driver-heuristics-sniffingLimit-- Throws:
IOExceptionSAXException
-
HtmlInputStreamReader
public HtmlInputStreamReader(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Heuristics heuristics) throws SAXException, IOException - Throws:
SAXExceptionIOException
-
HtmlInputStreamReader
public HtmlInputStreamReader(InputStream inputStream, ErrorHandler errorHandler, Tokenizer tokenizer, Driver driver, Encoding encoding) throws SAXException, IOException - Throws:
SAXExceptionIOException
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
- Overrides:
readin classReader- Throws:
IOException
-
readByte
Description copied from interface:ByteReadableReturns the value of the next byte as an integer from 0 to 0xFF or -1 if the stream has ended.- Specified by:
readBytein interfaceByteReadable- Returns:
- integer from 0 to 0xFF or -1 on EOF
- Throws:
IOException
-
main
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumberin interfaceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumberin interfaceLocator
-
getPublicId
- Specified by:
getPublicIdin interfaceLocator
-
getSystemId
- Specified by:
getSystemIdin interfaceLocator
-
getXMLVersion
- Specified by:
getXMLVersionin interfaceLocator2
-
getEncoding
- Specified by:
getEncodingin interfaceLocator2
-
getCharset
-
read
- Overrides:
readin classReader- Throws:
IOException- See Also:
-
read
- Specified by:
readin classReader- Throws:
IOException- See Also:
-
read
- Specified by:
readin interfaceReadable- Overrides:
readin classReader- Throws:
IOException- See Also:
-
switchEncoding
-