|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader java.io.InputStreamReader ftp2me.LineReader
public class LineReader
Can read a line from character streams. Uses only a single character "buffer". This is a faster, more memory-saving and simpler implementation of the BufferedReader, and implements only those methods vital for ftp2me, so it is not intended to be a drop-in replacement, or to be compatible with it by any means.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
LineReader(java.io.InputStream in)
Creates a LineReader instance out of an InputStream |
Method Summary | |
---|---|
void |
mark(int readLimit)
This method does nothing, do not use it. |
boolean |
markSupported()
We do not support mark(), so it returns constant false. |
int |
read()
Reads one character from the stream. |
int |
read(char[] cbuf)
Reads a character array from the stream. |
int |
read(char[] cbuf,
int off,
int len)
Reads a character array from the stream. |
java.lang.String |
readLine()
OK, this is the point. |
boolean |
ready()
Returns true if there is at least one character that can be returned immediately by a read() operation (without blocking the thread). |
void |
reset()
Again: mark not supported, so this should be used. |
long |
skip(long n)
Read n characters from the stream an discard them. |
Methods inherited from class java.io.InputStreamReader |
---|
close |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LineReader(java.io.InputStream in)
in
- InputStream from wich we readMethod Detail |
---|
public boolean markSupported()
markSupported
in class java.io.InputStreamReader
public void mark(int readLimit)
mark
in class java.io.InputStreamReader
public int read() throws java.io.IOException
read
in class java.io.InputStreamReader
java.io.IOException
public int read(char[] cbuf) throws java.io.IOException
read
in class java.io.Reader
cbuf
- Array of characters to fill.
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.InputStreamReader
cbuf
- Array of characters to fill (partially?).off
- Offset: first n characters in cbuf to be left alonelen
- Read that many characters
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStreamReader
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStreamReader
n
- Number of characters to discard
java.io.IOException
public boolean ready() throws java.io.IOException
ready
in class java.io.InputStreamReader
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |