Class QuotedPrintableOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.james.mime4j.codec.QuotedPrintableOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Performs Quoted-Printable encoding on an underlying stream.
Encodes every "required" char plus the dot ".". We encode the dot
by default because this is a workaround for some "filter"/"antivirus"
"old mua" having issues with dots at the beginning or the end of a
qp encode line (maybe a bad dot-destuffing algo).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate booleanprivate static final byteprivate static final intprivate static final byteprivate static final byteprivate static final byte[]private static final byteprivate intprivate final byte[]private intprivate booleanprivate booleanprivate booleanprivate static final byteprivate static final intprivate static final intprivate final byte[]private static final byteprivate static final byteFields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionQuotedPrintableOutputStream(int bufsize, OutputStream out, boolean binary) QuotedPrintableOutputStream(OutputStream out, boolean binary) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidclose()private voidprivate voidencode(byte next) private voidencodeChunk(byte[] buffer, int off, int len) private voidescape(byte next) voidflush()(package private) voidprivate voidprivate voidplain(byte next) private voidprivate voidwrite(byte next) voidwrite(byte[] b, int off, int len) voidwrite(int b) private voidMethods inherited from class FilterOutputStream
write
-
Field Details
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE- See Also:
-
TB
private static final byte TB- See Also:
-
SP
private static final byte SP- See Also:
-
EQ
private static final byte EQ- See Also:
-
DOT
private static final byte DOT- See Also:
-
CR
private static final byte CR- See Also:
-
LF
private static final byte LF- See Also:
-
QUOTED_PRINTABLE_LAST_PLAIN
private static final byte QUOTED_PRINTABLE_LAST_PLAIN- See Also:
-
QUOTED_PRINTABLE_MAX_LINE_LENGTH
private static final int QUOTED_PRINTABLE_MAX_LINE_LENGTH- See Also:
-
QUOTED_PRINTABLE_OCTETS_PER_ESCAPE
private static final int QUOTED_PRINTABLE_OCTETS_PER_ESCAPE- See Also:
-
HEX_DIGITS
private static final byte[] HEX_DIGITS -
outBuffer
private final byte[] outBuffer -
binary
private final boolean binary -
pendingSpace
private boolean pendingSpace -
pendingTab
private boolean pendingTab -
pendingCR
private boolean pendingCR -
nextSoftBreak
private int nextSoftBreak -
outputIndex
private int outputIndex -
closed
private boolean closed -
singleByte
private final byte[] singleByte
-
-
Constructor Details
-
QuotedPrintableOutputStream
-
QuotedPrintableOutputStream
-
-
Method Details
-
encodeChunk
- Throws:
IOException
-
completeEncoding
- Throws:
IOException
-
writePending
- Throws:
IOException
-
clearPending
- Throws:
IOException
-
encode
- Throws:
IOException
-
plain
- Throws:
IOException
-
escape
- Throws:
IOException
-
write
- Throws:
IOException
-
softBreak
- Throws:
IOException
-
lineBreak
- Throws:
IOException
-
flushOutput
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-