iaik.utils
Class LineOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--iaik.utils.LineOutputStream
- public class LineOutputStream
- extends java.io.FilterOutputStream
LineOutputStream is an OutputStream which can be used to write either
lines using methods print() and println() or byte arrays (stream interface).
And it is possible to switch between the two modes at any time.
This class may be useful for writing messages which start with
a couple of RFC822 headers followed by an arbitrary content (e.g. image/gif).
- See Also:
LineInputStream
| Fields inherited from class java.io.FilterOutputStream |
out |
|
Constructor Summary |
LineOutputStream(java.io.OutputStream out)
Creates a new LineOutputStream to write data to the specified underlying
output stream. |
|
Method Summary |
void |
print(java.lang.String s)
Print a String. |
void |
println()
Finish the line. |
void |
println(java.lang.String s)
Print a String, and then finish the line. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.io.FilterOutputStream |
close,
flush |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
LineOutputStream
public LineOutputStream(java.io.OutputStream out)
- Creates a new LineOutputStream to write data to the specified underlying
output stream.
- Parameters:
os - the underlying output stream
write
public void write(int b)
throws java.io.IOException
- Overrides:
- write in class java.io.FilterOutputStream
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
- write in class java.io.FilterOutputStream
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
- write in class java.io.FilterOutputStream
print
public void print(java.lang.String s)
throws java.io.IOException
- Print a String.
- Parameters:
s - the String to print
println
public void println(java.lang.String s)
throws java.io.IOException
- Print a String, and then finish the line.
- Parameters:
s - the String to print
println
public void println()
throws java.io.IOException
- Finish the line.