java.nio.charset
Class CharsetEncoder
java.lang.Object
java.nio.charset.CharsetEncoder
public abstract class CharsetEncoder
- extends Object
- Since:
- 1.4
Constructor Summary |
protected |
CharsetEncoder(Charset cs,
float averageBytesPerChar,
float maxBytesPerChar)
|
protected |
CharsetEncoder(Charset cs,
float averageBytesPerChar,
float maxBytesPerChar,
byte[] replacement)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CharsetEncoder
protected CharsetEncoder(Charset cs,
float averageBytesPerChar,
float maxBytesPerChar)
CharsetEncoder
protected CharsetEncoder(Charset cs,
float averageBytesPerChar,
float maxBytesPerChar,
byte[] replacement)
averageBytesPerChar
public final float averageBytesPerChar()
canEncode
public boolean canEncode(char c)
canEncode
public boolean canEncode(CharSequence cs)
charset
public final Charset charset()
encode
public final ByteBuffer encode(CharBuffer in)
throws CharacterCodingException
- Throws:
CharacterCodingException
encode
public final CoderResult encode(CharBuffer in,
ByteBuffer out,
boolean endOfInput)
encodeLoop
protected abstract CoderResult encodeLoop(CharBuffer in,
ByteBuffer out)
flush
public final CoderResult flush(ByteBuffer out)
implFlush
protected CoderResult implFlush(ByteBuffer out)
implOnMalformedInput
protected void implOnMalformedInput(CodingErrorAction newAction)
implOnUnmappableCharacter
protected void implOnUnmappableCharacter(CodingErrorAction newAction)
implReplaceWith
protected void implReplaceWith(byte[] newReplacement)
implReset
protected void implReset()
isLegalReplacement
public boolean isLegalReplacement(byte[] replacement)
malformedInputAction
public CodingErrorAction malformedInputAction()
maxBytesPerChar
public final float maxBytesPerChar()
onMalformedInput
public final CharsetEncoder onMalformedInput(CodingErrorAction newAction)
unmappableCharacterAction
public CodingErrorAction unmappableCharacterAction()
onUnmappableCharacter
public final CharsetEncoder onUnmappableCharacter(CodingErrorAction newAction)
replacement
public final byte[] replacement()
replaceWith
public final CharsetEncoder replaceWith(byte[] newReplacement)
reset
public final CharsetEncoder reset()