Package org.apache.james.mime4j.codec
Class QuotedPrintableInputStream
java.lang.Object
java.io.InputStream
org.apache.james.mime4j.codec.QuotedPrintableInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Performs Quoted-Printable decoding on an underlying stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ThreadLocal
<SoftReference<BufferRecycler>> private final RecycledByteArrayBuffer
private boolean
private static final byte
private final RecycledByteArrayBuffer
private static final int
private final byte[]
private static final byte
private final InputStream
private boolean
private static final byte
private int
private final DecodeMonitor
private int
private final byte[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
QuotedPrintableInputStream
(int bufsize, InputStream in, boolean strict) protected
QuotedPrintableInputStream
(int bufsize, InputStream in, DecodeMonitor monitor) QuotedPrintableInputStream
(InputStream in, boolean strict) QuotedPrintableInputStream
(InputStream in, DecodeMonitor monitor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Terminates Quoted-Printable coded content.private int
convert
(int c) Converts '0' => 0, 'A' => 10, etc.private int
static BufferRecycler
private int
getnext()
private int
peek
(int i) int
read()
int
read
(byte[] b, int off, int len) private int
read0
(byte[] buffer, int off, int len) private int
transfer
(int b, byte[] buffer, int from, int to, boolean keepblanks) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
_recyclerRef
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE- See Also:
-
EQ
private static final byte EQ- See Also:
-
CR
private static final byte CR- See Also:
-
LF
private static final byte LF- See Also:
-
singleByte
private final byte[] singleByte -
in
-
decodedBuf
-
blanks
-
encoded
private final byte[] encoded -
pos
private int pos -
limit
private int limit -
lastWasCR
private boolean lastWasCR -
closed
private boolean closed -
monitor
-
-
Constructor Details
-
QuotedPrintableInputStream
-
QuotedPrintableInputStream
-
QuotedPrintableInputStream
-
QuotedPrintableInputStream
-
QuotedPrintableInputStream
-
-
Method Details
-
getBufferRecycler
-
close
public void close()Terminates Quoted-Printable coded content. This method does NOT close the underlying input stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-
fillBuffer
- Throws:
IOException
-
getnext
private int getnext() -
peek
private int peek(int i) -
transfer
- Throws:
IOException
-
read0
- Throws:
IOException
-
convert
private int convert(int c) Converts '0' => 0, 'A' => 10, etc.- Parameters:
c
- ASCII character value.- Returns:
- Numeric value of hexadecimal character.
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-