Package net.freeutils.charset
Class PackedGSMCharset.Encoder
java.lang.Object
java.nio.charset.CharsetEncoder
net.freeutils.charset.EscapedByteLookupCharset.Encoder
net.freeutils.charset.PackedGSMCharset.Encoder
- Enclosing class:
PackedGSMCharset
The Encoder inner class handles the encoding of the
Packed GSM default encoding charset.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CoderResultencodeLoop(CharBuffer in, ByteBuffer out) Encodes one or more characters into one or more bytes.protected CoderResultimplFlush(ByteBuffer out) Flushes this encoder.protected voidResets this encoder, clearing any charset-specific internal state.protected CoderResultpack(ByteBuffer in, ByteBuffer out) Packs the given data into full bytes.Methods inherited from class java.nio.charset.CharsetEncoder
averageBytesPerChar, canEncode, canEncode, charset, encode, encode, flush, implOnMalformedInput, implOnUnmappableCharacter, implReplaceWith, isLegalReplacement, malformedInputAction, maxBytesPerChar, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction
-
Constructor Details
-
Encoder
Constructs an Encoder.- Parameters:
cs- the charset to which this encoder belongs
-
-
Method Details
-
implReset
protected void implReset()Resets this encoder, clearing any charset-specific internal state.- Overrides:
implResetin classCharsetEncoder
-
implFlush
Flushes this encoder.- Overrides:
implFlushin classCharsetEncoder- Parameters:
out- The output byte buffer- Returns:
- A coder-result object, either
CoderResult.UNDERFLOWorCoderResult.OVERFLOW
-
encodeLoop
Encodes one or more characters into one or more bytes.- Overrides:
encodeLoopin classEscapedByteLookupCharset.Encoder- Parameters:
in- the input character bufferout- the output byte buffer- Returns:
- a coder-result object describing the reason for termination
-
pack
Packs the given data into full bytes.- Parameters:
in- the input byte bufferout- the output byte buffer- Returns:
- A coder-result object, either
CoderResult.UNDERFLOWorCoderResult.OVERFLOW
-