|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.w3c.tidy.StreamInImpl
Input Stream Implementation. This implementation is from the c version of tidy and it doesn't take advantage of java readers.
Field Summary | |
private int |
bufpos
actual position in buffer. |
private int[] |
charbuf
character buffer. |
private static int |
CHARBUF_SIZE
number of characters kept in buffer. |
private int |
curcol
current column number. |
private int |
curline
current line number. |
private int |
encoding
Encoding. |
private boolean |
endOfStream
has end of stream been reached? |
private EncodingUtils.GetBytes |
getBytes
Getter. |
private int |
lastcol
last column. |
private Lexer |
lexer
needed for error reporting. |
private boolean |
lookingForBOM
looking for an UTF BOM? |
private boolean |
pushed
|
private int |
rawBufpos
actual position in rawBytebuf. |
private char[] |
rawBytebuf
Private unget buffer for the raw bytes read from the input stream. |
private boolean |
rawOut
Avoid mapping values > 127 to entities. |
private boolean |
rawPushed
has a raw byte been pushed into stack? |
private int |
state
FSM for ISO2022. |
private java.io.InputStream |
stream
input stream. |
private int |
tabs
|
private int |
tabsize
tab size in chars. |
Fields inherited from interface org.w3c.tidy.StreamIn |
END_OF_STREAM |
Constructor Summary | |
StreamInImpl(java.io.InputStream stream,
Configuration configuration)
Instatiates a new StreamInImpl. |
Method Summary | |
int |
getCurcol()
Getter for curcol . |
int |
getCurline()
Getter for curline . |
boolean |
isEndOfStream()
Has end of stream been reached? |
int |
readChar()
Read a char. |
int |
readCharFromStream()
reads a char from the stream. |
protected void |
readRawBytesFromStream(int[] buf,
int[] count,
boolean unget)
Read raw bytes from stream, return <= 0 if EOF; or if "unget" is true, Unget the bytes to re-synchronize the input stream Normally UTF-8 successor bytes are read using this routine. |
void |
setLexer(Lexer lexer)
Setter for lexer . |
void |
ungetChar(int c)
Unget a char. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int CHARBUF_SIZE
private Lexer lexer
private int[] charbuf
private int bufpos
private char[] rawBytebuf
private int rawBufpos
private boolean rawPushed
private boolean lookingForBOM
private boolean endOfStream
private boolean pushed
private int tabs
private int tabsize
private int state
private int encoding
private int curcol
private int lastcol
private int curline
private java.io.InputStream stream
private EncodingUtils.GetBytes getBytes
private boolean rawOut
Constructor Detail |
public StreamInImpl(java.io.InputStream stream, Configuration configuration)
stream
- input streamconfiguration
- ConfigurationMethod Detail |
public int getCurcol()
StreamIn
curcol
.
getCurcol
in interface StreamIn
StreamIn.getCurcol()
public int getCurline()
StreamIn
curline
.
getCurline
in interface StreamIn
StreamIn.getCurline()
public void setLexer(Lexer lexer)
lexer
.
setLexer
in interface StreamIn
lexer
- The lexer to set.public int readChar()
StreamIn
readChar
in interface StreamIn
StreamIn.readChar()
public void ungetChar(int c)
StreamIn
ungetChar
in interface StreamIn
c
- charStreamIn.ungetChar(int)
public boolean isEndOfStream()
StreamIn
isEndOfStream
in interface StreamIn
true
if end of stream has been reachedStreamIn.isEndOfStream()
public int readCharFromStream()
StreamIn
readCharFromStream
in interface StreamIn
StreamIn.readCharFromStream()
protected void readRawBytesFromStream(int[] buf, int[] count, boolean unget)
buf
- character buffercount
- number of bytes to readunget
- unget bytes
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |