public class CRLFOutputStream
extends java.io.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).
|
Constructor and Description |
---|
CRLFOutputStream(java.io.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.
|
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(java.io.OutputStream out)
out
- the OutputStream to be wrappedpublic void write(int b) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- the byte to writejava.io.IOException
- if an error occurs writing the byteprotected void writeChunk(byte[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
FilterOutputStream.write(byte[], int, int)
public void write(byte[] buffer, int offset, int length) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
FilterOutputStream.write(byte[], int, int)
public void checkCRLFTerminator() throws java.io.IOException
java.io.IOException
- if an error occurs writing the byteCopyright © 2006-2013. All Rights Reserved.