public class CRLFOutputStream extends FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected static int |
LAST_WAS_CR |
protected static int |
LAST_WAS_LF |
protected static int |
LAST_WAS_OTHER |
protected boolean |
startOfLine |
protected int |
statusLast
Counter for number of last (0A or 0D).
|
out| Constructor and Description |
|---|
CRLFOutputStream(OutputStream out)
Constructor that wraps an OutputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkCRLFTerminator()
Ensure that the stream is CRLF terminated.
|
void |
write(byte[] buffer,
int offset,
int length) |
void |
write(int b)
Writes a byte to the stream Fixes any naked CR or LF to the RFC 2821
mandated CFLF pairing.
|
protected void |
writeChunk(byte[] buffer,
int offset,
int length)
Provides an extension point for ExtraDotOutputStream to be able to add
dots at the beginning of new lines.
|
close, flush, writeprotected int statusLast
protected static final int LAST_WAS_OTHER
protected static final int LAST_WAS_CR
protected static final int LAST_WAS_LF
protected boolean startOfLine
public CRLFOutputStream(OutputStream out)
out - the OutputStream to be wrappedpublic void write(int b)
throws IOException
write in class FilterOutputStreamb - the byte to writeIOException - if an error occurs writing the byteprotected void writeChunk(byte[] buffer,
int offset,
int length)
throws IOException
buffer - byte bufferoffset - int offsetlength - and lengthIOExceptionFilterOutputStream.write(byte[], int, int)public void write(byte[] buffer,
int offset,
int length)
throws IOException
write in class FilterOutputStreambuffer - byte bufferoffset - int offsetlength - and lengthIOExceptionFilterOutputStream.write(byte[], int, int)public void checkCRLFTerminator()
throws IOException
IOException - if an error occurs writing the byteCopyright © 2009–2015. All rights reserved.