|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.util.LineReaderWriter
public class LineReaderWriter
This is a tiny helper class to provide readLine and println methods around InputStream and OutputStream. In contrast to BufferedReader and PrintWriter (which are not available on CDLC anyways), the implementations in this class are unbuffered, and reading a line therefore does not consume too many bytes from the underlying stream (as BufferedReader would do). This makes it possible to call readLine on an InputStream and then re-use it for binary transfers.
| Constructor Summary | |
|---|---|
LineReaderWriter()
|
|
| Method Summary | |
|---|---|
static void |
println(java.io.OutputStream out,
java.lang.String line)
Print a line to an OutputStream, temporarily wrapping it in an OutputStreamWriter. |
static void |
println(java.io.OutputStreamWriter out,
java.lang.String line)
Print a line to an OutputStreamWriter. |
static java.lang.String |
readLine(java.io.InputStream in)
just calls readLine(in, -1). |
static java.lang.String |
readLine(java.io.InputStream in,
int timeoutMs)
Read a line from an InputStream (until a '\n' character is encountered). |
static int |
readWithTimeout(java.io.InputStream in,
int timeoutMs)
If timeoutMs > 0, then this method first waits for a byte to become available in in before reading it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LineReaderWriter()
| Method Detail |
|---|
public static int readWithTimeout(java.io.InputStream in,
int timeoutMs)
throws java.io.IOException
java.io.IOException
public static java.lang.String readLine(java.io.InputStream in,
int timeoutMs)
throws java.io.IOException
java.io.IOException
public static java.lang.String readLine(java.io.InputStream in)
throws java.io.IOException
java.io.IOException
public static void println(java.io.OutputStream out,
java.lang.String line)
throws java.io.IOException
java.io.IOException
public static void println(java.io.OutputStreamWriter out,
java.lang.String line)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||