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
_chunksBeforeLf
We 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 byte
LF_BYTE
(package private) static byte
LF_CHAR
(package private) static byte
PAD_BYTE
(package private) static char
PAD_CHAR
-
Fields inherited from class org.codehaus.stax2.ri.typed.AsciiValueEncoder
MIN_CHARS_WITHOUT_FLUSH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Base64Encoder(Base64Variant v, byte[] values, int from, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
encodeMore(byte[] buffer, int outPtr, int outEnd)
int
encodeMore(char[] buffer, int outPtr, int outEnd)
boolean
isCompleted()
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:AsciiValueEncoder
Method 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:
isCompleted
in classAsciiValueEncoder
-
encodeMore
public int encodeMore(char[] buffer, int outPtr, int outEnd)
- Specified by:
encodeMore
in 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:
encodeMore
in 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)
-
-