public class HexEncoder extends ByteToCharEncoder<HexEncoder>
Encodes to "hexadecimal encoding", where each byte is represented by 2 characters (0-padded if necessary).
Can be configured to encode using a specific character list.
This is designed only for choosing between the HexUpperCharList
(default) and
HexLowerCharList
, as the HexDecoder
currently does not offer a reciprocal configuration option and can only decode from the
standard format used by these lists.
Modifier and Type | Field and Description |
---|---|
protected char[] |
byteToCharList |
static String |
DEFAULT_SECTION_SEPARATOR |
protected String |
sectionSeparator |
protected int |
separatorFreq |
protected long |
sepBytesWritten |
averageOutPerIn, maxOutPerIn, minInPerOut, state
Constructor and Description |
---|
HexEncoder() |
Modifier and Type | Method and Description |
---|---|
protected CoderResult |
codingLoop(ByteBuffer in,
CharBuffer out,
boolean endOfInput) |
protected void |
configImpl(HexEncoder base)
Hook for implementations to configure themselves from another instance.
|
char[] |
getByteToCharList() |
String |
getSectionSeparator() |
int |
getSeparatorFreq() |
protected void |
init()
Hook called once after the first coding operation is started.
|
protected void |
resetImpl()
Hook called from
BaseCoder.reset() . |
HexEncoder |
setByteToCharList(char[] byteToCharList) |
HexEncoder |
setSectionSeparator(String sectionSeparator) |
HexEncoder |
setSeparatorFreq(int separatorFreq) |
allocate, encodeToString, put
checkConfigAllowed, checkNullArgument, clone, code, code, config, flush, getAverageOutPerIn, getMaxOutPerIn, getMinInPerOut, implFlush, reset, throwIllegalStateException
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, code, code, config, flush, getAverageOutPerIn, getMaxOutPerIn, getMinInPerOut, reset
public static final String DEFAULT_SECTION_SEPARATOR
protected char[] byteToCharList
protected String sectionSeparator
protected int separatorFreq
protected transient long sepBytesWritten
protected void configImpl(HexEncoder base)
BaseCoder
Hook for implementations to configure themselves from another instance. The base implementation does nothing.
configImpl
in class BaseCoder<ByteBuffer,CharBuffer,HexEncoder>
base
- The instance to copy the configuration from.protected void init()
BaseCoder
Hook called once after the first coding operation is started. The base implementation does nothing.
init
in class BaseCoder<ByteBuffer,CharBuffer,HexEncoder>
public char[] getByteToCharList()
public HexEncoder setByteToCharList(char[] byteToCharList)
public String getSectionSeparator()
public HexEncoder setSectionSeparator(String sectionSeparator)
public int getSeparatorFreq()
public HexEncoder setSeparatorFreq(int separatorFreq)
protected CoderResult codingLoop(ByteBuffer in, CharBuffer out, boolean endOfInput)
codingLoop
in class BaseCoder<ByteBuffer,CharBuffer,HexEncoder>
protected void resetImpl()
BaseCoder
Hook called from BaseCoder.reset()
.
The base implementation does nothing.
resetImpl
in class BaseCoder<ByteBuffer,CharBuffer,HexEncoder>
Copyright © 2009–2017 Mark A. Ziesemer. All rights reserved.