Package org.apache.james.mime4j.codec
Class Base64InputStream
java.lang.Object
java.io.InputStream
org.apache.james.mime4j.codec.Base64InputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Performs Base-64 decoding on an underlying stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ThreadLocal
<SoftReference<BufferRecycler>> private static final int[]
private static final byte
private boolean
private final RecycledByteArrayBuffer
private final byte[]
private static final int
private boolean
private static final int
private final InputStream
private final DecodeMonitor
private int
private final byte[]
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Base64InputStream
(int bufsize, InputStream in, DecodeMonitor monitor) Base64InputStream
(InputStream in, boolean strict) Base64InputStream
(InputStream in, DecodeMonitor monitor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private int
decodePad
(int data, int sextets, byte[] buffer, int index, int end) static BufferRecycler
private void
handleUnexpecedPad
(int sextets) private void
handleUnexpectedEof
(int sextets) int
read()
int
read
(byte[] buffer) int
read
(byte[] buffer, int offset, int length) private int
read0
(byte[] buffer, int off, int len) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
_recyclerRef
-
ENCODED_BUFFER_SIZE
private static final int ENCODED_BUFFER_SIZE- See Also:
-
BASE64_DECODE
private static final int[] BASE64_DECODE -
BASE64_PAD
private static final byte BASE64_PAD- See Also:
-
EOF
private static final int EOF- See Also:
-
singleByte
private final byte[] singleByte -
in
-
encoded
private final byte[] encoded -
decodedBuf
-
position
private int position -
size
private int size -
closed
private boolean closed -
eof
private boolean eof -
monitor
-
-
Constructor Details
-
Base64InputStream
-
Base64InputStream
-
Base64InputStream
-
Base64InputStream
-
-
Method Details
-
getBufferRecycler
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read0
- Throws:
IOException
-
decodePad
- Throws:
IOException
-
handleUnexpectedEof
- Throws:
IOException
-
handleUnexpecedPad
- Throws:
IOException
-