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 CoderResult
encodeLoop
(CharBuffer in, ByteBuffer out) Encodes one or more characters into one or more bytes.protected CoderResult
implFlush
(ByteBuffer out) Flushes this encoder.protected void
Resets this encoder, clearing any charset-specific internal state.protected CoderResult
pack
(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:
implReset
in classCharsetEncoder
-
implFlush
Flushes this encoder.- Overrides:
implFlush
in classCharsetEncoder
- Parameters:
out
- The output byte buffer- Returns:
- A coder-result object, either
CoderResult.UNDERFLOW
orCoderResult.OVERFLOW
-
encodeLoop
Encodes one or more characters into one or more bytes.- Overrides:
encodeLoop
in 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.UNDERFLOW
orCoderResult.OVERFLOW
-