public abstract class CharsetEncoder extends Object
Modifier | Constructor and Description |
---|---|
protected |
CharsetEncoder(Charset cs,
float averageBytesPerChar,
float maxBytesPerChar) |
protected |
CharsetEncoder(Charset cs,
float averageBytesPerChar,
float maxBytesPerChar,
byte[] replacement) |
protected CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar)
protected CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement)
public final float averageBytesPerChar()
public boolean canEncode(char c)
public boolean canEncode(CharSequence cs)
public final ByteBuffer encode(CharBuffer in) throws CharacterCodingException
CharacterCodingException
public final CoderResult encode(CharBuffer in, ByteBuffer out, boolean endOfInput)
protected abstract CoderResult encodeLoop(CharBuffer in, ByteBuffer out)
public final CoderResult flush(ByteBuffer out)
protected CoderResult implFlush(ByteBuffer out)
protected void implOnMalformedInput(CodingErrorAction newAction)
protected void implOnUnmappableCharacter(CodingErrorAction newAction)
protected void implReplaceWith(byte[] newReplacement)
protected void implReset()
public boolean isLegalReplacement(byte[] replacement)
public CodingErrorAction malformedInputAction()
public final float maxBytesPerChar()
public final CharsetEncoder onMalformedInput(CodingErrorAction newAction)
public CodingErrorAction unmappableCharacterAction()
public final CharsetEncoder onUnmappableCharacter(CodingErrorAction newAction)
public final byte[] replacement()
public final CharsetEncoder replaceWith(byte[] newReplacement)
public final CharsetEncoder reset()