iaik.utils
Class LineOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
              |
              +--iaik.utils.LineOutputStream

public class LineOutputStream
extends 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).

Version:
File Revision 15
See Also:
LineInputStream

Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
LineOutputStream(OutputStream out)
          Creates a new LineOutputStream to write data to the specified underlying output stream.
 
Method Summary
 void print(String s)
          Print a String.
 void println()
          Finish the line.
 void println(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
 

Constructor Detail

LineOutputStream

public LineOutputStream(OutputStream out)
Creates a new LineOutputStream to write data to the specified underlying output stream.
Parameters:
os - the underlying output stream
Method Detail

write

public void write(int b)
           throws IOException
Overrides:
write in class FilterOutputStream

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class FilterOutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterOutputStream

print

public void print(String s)
           throws IOException
Print a String.
Parameters:
s - the String to print

println

public void println(String s)
             throws IOException
Print a String, and then finish the line.
Parameters:
s - the String to print

println

public void println()
             throws IOException
Finish the line.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK