com.limegroup.gnutella
Class ByteReader
java.lang.Object
com.limegroup.gnutella.ByteReader
- public class ByteReader
- extends java.lang.Object
Provides the readLine method of a BufferedReader with no no automatic
buffering. All methods are like those in InputStream except they return
-1 instead of throwing IOException.
Constructor Summary |
ByteReader(java.io.InputStream stream)
|
Method Summary |
void |
close()
|
int |
read()
|
int |
read(byte[] buf)
|
int |
read(byte[] buf,
int offset,
int length)
|
java.lang.String |
readLine()
Reads a new line WITHOUT end of line characters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteReader
public ByteReader(java.io.InputStream stream)
close
public void close()
read
public int read()
read
public int read(byte[] buf)
read
public int read(byte[] buf,
int offset,
int length)
readLine
public java.lang.String readLine()
throws java.io.IOException
- Reads a new line WITHOUT end of line characters. A line is
defined as a minimal sequence of character ending with "\n", with
all "\r"'s thrown away. Hence calling readLine on a stream
containing "abc\r\n" or "a\rbc\n" will return "abc".
Throws IOException if there is an IO error. Returns null if
there are no more lines to read, i.e., EOF has been reached.
Note that calling readLine on "ab" returns null.
- Throws:
java.io.IOException