java.nio.charset

Class 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)
Method Summary
floataverageBytesPerChar()
booleancanEncode(char c)
booleancanEncode(CharSequence cs)
Charsetcharset()
ByteBufferencode(CharBuffer in)
CoderResultencode(CharBuffer in, ByteBuffer out, boolean endOfInput)
protected abstract CoderResultencodeLoop(CharBuffer in, ByteBuffer out)
CoderResultflush(ByteBuffer out)
protected CoderResultimplFlush(ByteBuffer out)
protected voidimplOnMalformedInput(CodingErrorAction newAction)
protected voidimplOnUnmappableCharacter(CodingErrorAction newAction)
protected voidimplReplaceWith(byte[] newReplacement)
protected voidimplReset()
booleanisLegalReplacement(byte[] replacement)
CodingErrorActionmalformedInputAction()
floatmaxBytesPerChar()
CharsetEncoderonMalformedInput(CodingErrorAction newAction)
CharsetEncoderonUnmappableCharacter(CodingErrorAction newAction)
byte[]replacement()
CharsetEncoderreplaceWith(byte[] newReplacement)
CharsetEncoderreset()
CodingErrorActionunmappableCharacterAction()

Constructor Detail

CharsetEncoder

protected CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar)

CharsetEncoder

protected CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement)

Method Detail

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)

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)

onUnmappableCharacter

public final CharsetEncoder onUnmappableCharacter(CodingErrorAction newAction)

replacement

public final byte[] replacement()

replaceWith

public final CharsetEncoder replaceWith(byte[] newReplacement)

reset

public final CharsetEncoder reset()

unmappableCharacterAction

public CodingErrorAction unmappableCharacterAction()