FileDocCategorySizeDatePackage
LineOutputStream.javaAPI DocJavaMail 1.4.32745Tue Nov 17 10:38:12 GMT 2009com.sun.mail.util

LineOutputStream

public class LineOutputStream extends FilterOutputStream
This class is to support writing out Strings as a sequence of bytes terminated by a CRLF sequence. The String must contain only US-ASCII characters.

The expected use is to write out RFC822 style headers to an output stream.

author
John Mani

Fields Summary
private static byte[]
newline
Constructors Summary
public LineOutputStream(OutputStream out)

	newline = new byte[2];
	newline[0] = (byte)'\r";
	newline[1] = (byte)'\n";
    
	super(out);
    
Methods Summary
public voidwriteln(java.lang.String s)

	byte[] bytes = ASCIIUtility.getBytes(s);
	out.write(bytes);
	out.write(newline);
    
public voidwriteln()

	out.write(newline);