public class LineNumberInputStream extends FilterInputStream implements LineNumberSource
InputStream
used by the parser to wrap the original user
supplied stream. This stream keeps track of the current line number.in
Constructor and Description |
---|
LineNumberInputStream(InputStream is)
Creates a new
LineNumberInputStream . |
Modifier and Type | Method and Description |
---|---|
int |
getLineNumber()
Gets the current line number starting at 1 (the number of
\r\n read so far plus 1). |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
available, close, mark, markSupported, read, reset, skip
public LineNumberInputStream(InputStream is)
LineNumberInputStream
.is
- the stream to read from.public int getLineNumber()
LineNumberSource
\r\n
read so far plus 1).getLineNumber
in interface LineNumberSource
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.