nu.validator.htmlparser.io
Class HtmlInputStreamReader
java.lang.Object
java.io.Reader
nu.validator.htmlparser.io.HtmlInputStreamReader
- All Implemented Interfaces:
- Closeable, Readable, ByteReadable, Locator
public final class HtmlInputStreamReader
- extends Reader
- implements 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Specified by:
close in class Reader
- Throws:
IOException
read
public int read(char[] charArray)
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException
readByte
public int readByte()
throws IOException
- 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 interface ByteReadable
- Returns:
- integer from 0 to 0xFF or -1 on EOF
- Throws:
IOException
main
public static void main(String[] args)
getColumnNumber
public int getColumnNumber()
- Specified by:
getColumnNumber in interface Locator
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumber in interface Locator
getPublicId
public String getPublicId()
- Specified by:
getPublicId in interface Locator
getSystemId
public String getSystemId()
- Specified by:
getSystemId in interface Locator
getCharset
public Charset getCharset()
read
public int read()
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException- See Also:
Reader.read()
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
read in class Reader
- Throws:
IOException- See Also:
Reader.read(char[], int, int)
read
public int read(CharBuffer target)
throws IOException
- Specified by:
read in interface Readable- Overrides:
read in class Reader
- Throws:
IOException- See Also:
Reader.read(java.nio.CharBuffer)
switchEncoding
public void switchEncoding(Encoding newEnc)
Copyright © 2012. All Rights Reserved.