FileDocCategorySizeDatePackage
CRLFOutputStream.javaAPI DocBouncy Castle Crypto API 1.41 (Java 1.5)1264Wed Oct 01 10:55:28 BST 2008org.bouncycastle.mail.smime.util

CRLFOutputStream

public class CRLFOutputStream extends FilterOutputStream

Fields Summary
protected int
lastb
protected static byte[]
newline
Constructors Summary
public CRLFOutputStream(OutputStream outputstream)

        super(outputstream);
        lastb = -1;
    
Methods Summary
public voidwrite(int i)

        if (i == '\r")
        {
            out.write(newline);
        }
        else if (i == '\n")
        {
            if (lastb != '\r")
            {
                out.write(newline);
            }
        }
        else
        {
           out.write(i);
        }
        
        lastb = i;
    
public voidwrite(byte[] buf)

        this.write(buf, 0, buf.length);
    
public voidwrite(byte[] buf, int off, int len)

        for (int i = off; i != off + len; i++)
        {
            this.write(buf[i]);
        }
    
public voidwriteln()

        super.out.write(newline);