Package org.apache.james.mime4j.codec
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 boolean
private boolean
private static final byte
private static final int
private static final byte
private static final byte
private static final byte[]
private static final byte
private int
private final byte[]
private int
private boolean
private boolean
private boolean
private static final byte
private static final int
private static final int
private final byte[]
private static final byte
private static final byte
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionQuotedPrintableOutputStream
(int bufsize, OutputStream out, boolean binary) QuotedPrintableOutputStream
(OutputStream out, boolean binary) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
close()
private void
private void
encode
(byte next) private void
encodeChunk
(byte[] buffer, int off, int len) private void
escape
(byte next) void
flush()
(package private) void
private void
private void
plain
(byte next) private void
private void
write
(byte next) void
write
(byte[] b, int off, int len) void
write
(int b) private void
Methods inherited from class java.io.FilterOutputStream
write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-