Package org.codehaus.stax2.ri.typed
Class ValueEncoderFactory.Base64Encoder
- java.lang.Object
-
- org.codehaus.stax2.ri.typed.AsciiValueEncoder
-
- org.codehaus.stax2.ri.typed.ValueEncoderFactory.Base64Encoder
-
- Enclosing class:
- ValueEncoderFactory
static final class ValueEncoderFactory.Base64Encoder extends AsciiValueEncoder
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int_chunksBeforeLfWe need a counter to know when to add mandatory linefeed.(package private) byte[]_input(package private) int_inputEnd(package private) int_inputPtr(package private) Base64Variant_variant(package private) static byteLF_BYTE(package private) static byteLF_CHAR(package private) static bytePAD_BYTE(package private) static charPAD_CHAR-
Fields inherited from class org.codehaus.stax2.ri.typed.AsciiValueEncoder
MIN_CHARS_WITHOUT_FLUSH
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBase64Encoder(Base64Variant v, byte[] values, int from, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intencodeMore(byte[] buffer, int outPtr, int outEnd)intencodeMore(char[] buffer, int outPtr, int outEnd)booleanisCompleted()Method that can alternatively be called to determine whether encoder has encoded all data it has.-
Methods inherited from class org.codehaus.stax2.ri.typed.AsciiValueEncoder
bufferNeedsFlush
-
-
-
-
Field Detail
-
PAD_CHAR
static final char PAD_CHAR
- See Also:
- Constant Field Values
-
PAD_BYTE
static final byte PAD_BYTE
- See Also:
- Constant Field Values
-
LF_CHAR
static final byte LF_CHAR
- See Also:
- Constant Field Values
-
LF_BYTE
static final byte LF_BYTE
- See Also:
- Constant Field Values
-
_variant
final Base64Variant _variant
-
_input
final byte[] _input
-
_inputPtr
int _inputPtr
-
_inputEnd
final int _inputEnd
-
_chunksBeforeLf
int _chunksBeforeLf
We need a counter to know when to add mandatory linefeed.
-
-
Constructor Detail
-
Base64Encoder
protected Base64Encoder(Base64Variant v, byte[] values, int from, int end)
-
-
Method Detail
-
isCompleted
public boolean isCompleted()
Description copied from class:AsciiValueEncoderMethod that can alternatively be called to determine whether encoder has encoded all data it has. Generally called right after a call toAsciiValueEncoder.encodeMore(char[], int, int), to figure out whether buffer flush is needed (there is more data), or encoding is complete.- Specified by:
isCompletedin classAsciiValueEncoder
-
encodeMore
public int encodeMore(char[] buffer, int outPtr, int outEnd)- Specified by:
encodeMorein classAsciiValueEncoder- Returns:
- Value of pointer after all remaining data (which
may be "none") that can be encoded (as constrained by
buffer length) has been encoded. Has to exceed 'ptr'
value sent in; will be equal to it if nothing was
encoded (which should only occur when everything has
been encoded, as long as
AsciiValueEncoder.bufferNeedsFlush(int)is appropriately called once before calling this method)
-
encodeMore
public int encodeMore(byte[] buffer, int outPtr, int outEnd)- Specified by:
encodeMorein classAsciiValueEncoder- Returns:
- Value of pointer after all remaining data (which
may be "none") that can be encoded (as constrained by
buffer length) has been encoded. Has to exceed 'ptr'
value sent in; will be equal to it if nothing was
encoded (which should only occur when everything has
been encoded, as long as
AsciiValueEncoder.bufferNeedsFlush(int)is appropriately called once before calling this method)
-
-