gnu.inet.util
Class LineInputStream
java.lang.Object
java.io.InputStream
gnu.inet.util.LineInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class LineInputStream
- extends java.io.InputStream
An input stream that can read lines of input.
- Author:
- Chris Burdess
Field Summary |
protected java.io.InputStream |
in
The underlying input stream. |
Constructor Summary |
LineInputStream(java.io.InputStream in)
Constructor using the US-ASCII character encoding. |
LineInputStream(java.io.InputStream in,
java.lang.String encoding)
Constructor. |
Method Summary |
int |
read()
|
int |
read(byte[] buf)
|
int |
read(byte[] buf,
int off,
int len)
|
java.lang.String |
readLine()
Read a line of input. |
Methods inherited from class java.io.InputStream |
available, close, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected java.io.InputStream in
- The underlying input stream.
LineInputStream
public LineInputStream(java.io.InputStream in)
- Constructor using the US-ASCII character encoding.
- Parameters:
in
- the underlying input stream
LineInputStream
public LineInputStream(java.io.InputStream in,
java.lang.String encoding)
- Constructor.
- Parameters:
in
- the underlying input streamencoding
- the character encoding to use
read
public int read()
throws java.io.IOException
- Specified by:
read
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf,
int off,
int len)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
readLine
public java.lang.String readLine()
throws java.io.IOException
- Read a line of input.
- Throws:
java.io.IOException
© Copyright 2003 The Free Software Foundation,
all rights reserved