public class CharArrayBase64Decoder extends Object
Modifier and Type | Field and Description |
---|---|
protected char[] |
_currSegment
Text segment being currently processed.
|
protected int |
_currSegmentEnd |
protected int |
_currSegmentPtr |
protected int |
_lastSegmentEnd |
protected int |
_lastSegmentOffset |
protected int |
_nextSegmentIndex
Pointer of the next segment to process (after current one stored
in
_currSegment ) within _nextSegments . |
protected ArrayList<char[]> |
_nextSegments |
Constructor and Description |
---|
CharArrayBase64Decoder() |
Modifier and Type | Method and Description |
---|---|
int |
decode(byte[] resultBuffer,
int resultOffset,
int maxLength)
Method that does actual decoding
|
byte[] |
decodeCompletely()
Method that can be called to completely decode content that this
decoder has been initialized with.
|
int |
endOfContent()
Method called to indicate that we have no more encoded content to
process, and decoding is to finish.
|
Stax2Util.ByteAggregator |
getByteAggregator() |
boolean |
hasData()
Method that can be called to check if this decoder is in has unflushed
data ready to be returned.
|
void |
init(Base64Variant variant,
boolean firstChunk,
char[] lastSegment,
int lastOffset,
int lastLen,
List<char[]> segments) |
protected IllegalArgumentException |
reportInvalidChar(char ch,
int bindex) |
protected IllegalArgumentException |
reportInvalidChar(char ch,
int bindex,
String msg) |
protected char[] _currSegment
protected int _currSegmentPtr
protected int _currSegmentEnd
protected final ArrayList<char[]> _nextSegments
protected int _lastSegmentOffset
protected int _lastSegmentEnd
protected int _nextSegmentIndex
_currSegment
) within _nextSegments
.public void init(Base64Variant variant, boolean firstChunk, char[] lastSegment, int lastOffset, int lastLen, List<char[]> segments)
public int decode(byte[] resultBuffer, int resultOffset, int maxLength) throws IllegalArgumentException
resultBuffer
- Buffer in which decoded bytes are returnedresultOffset
- Offset that points to position to put the
first decoded byte in maxLength Maximum number of bytes that can be returned
in given bufferIllegalArgumentException
public final boolean hasData()
public final int endOfContent()
public byte[] decodeCompletely()
public Stax2Util.ByteAggregator getByteAggregator()
protected IllegalArgumentException reportInvalidChar(char ch, int bindex) throws IllegalArgumentException
IllegalArgumentException
protected IllegalArgumentException reportInvalidChar(char ch, int bindex, String msg) throws IllegalArgumentException
bindex
- Relative index within base64 character unit; between 0
and 3 (as unit has exactly 4 characters)IllegalArgumentException
Copyright © 2012-2015 fasterxml.com. All Rights Reserved.