gnu.inet.util

Class CRLFOutputStream


public class CRLFOutputStream
extends FilterOutputStream

An output stream that filters LFs into CR/LF pairs.
Author:
Chris Burdess

Field Summary

static int
CR
The CR octet.
static byte[]
CRLF
The CR/LF pair.
static int
LF
The LF octet.
protected int
last
The last byte read.

Constructor Summary

CRLFOutputStream(OutputStream out)
Constructs a CR/LF output stream connected to the specified output stream.

Method Summary

void
write(String text)
Writes the specified ASCII string to the underlying stream.
void
write(byte[] b)
Writes a byte array to the underlying stream.
void
write(byte[] b, int off, int len)
Writes a portion of a byte array to the underlying stream.
void
write(int ch)
Writes a character to the underlying stream.
void
writeln()
Writes a newline to the underlying stream.

Field Details

CR

public static final int CR
The CR octet.
Field Value:
13

CRLF

public static final byte[] CRLF
The CR/LF pair.

LF

public static final int LF
The LF octet.
Field Value:
10

last

protected int last
The last byte read.

Constructor Details

CRLFOutputStream

public CRLFOutputStream(OutputStream out)
Constructs a CR/LF output stream connected to the specified output stream.

Method Details

write

public void write(String text)
            throws IOException
Writes the specified ASCII string to the underlying stream.

write

public void write(byte[] b)
            throws IOException
Writes a byte array to the underlying stream.

write

public void write(byte[] b,
                  int off,
                  int len)
            throws IOException
Writes a portion of a byte array to the underlying stream.

write

public void write(int ch)
            throws IOException
Writes a character to the underlying stream.

writeln

public void writeln()
            throws IOException
Writes a newline to the underlying stream.

© Copyright 2003 The Free Software Foundation, all rights reserved