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, write
protected 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 FilterOutputStream
b
- the byte to writeIOException
- if an error occurs writing the byteprotected void writeChunk(byte[] buffer, int offset, int length) throws IOException
IOException
FilterOutputStream.write(byte[], int, int)
public void write(byte[] buffer, int offset, int length) throws IOException
write
in class FilterOutputStream
IOException
FilterOutputStream.write(byte[], int, int)
public void checkCRLFTerminator() throws IOException
IOException
- if an error occurs writing the byteCopyright © 2012-2018. All Rights Reserved.