java.nio.charset
Class CharsetEncoder

java.lang.Object
  extended by 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)
           
 
Method Summary
 float averageBytesPerChar()
           
 boolean canEncode(char c)
           
 boolean canEncode(CharSequence cs)
           
 Charset charset()
           
 ByteBuffer encode(CharBuffer in)
           
 CoderResult encode(CharBuffer in, ByteBuffer out, boolean endOfInput)
           
protected abstract  CoderResult encodeLoop(CharBuffer in, ByteBuffer out)
           
 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()
           
 boolean isLegalReplacement(byte[] replacement)
           
 CodingErrorAction malformedInputAction()
           
 float maxBytesPerChar()
           
 CharsetEncoder onMalformedInput(CodingErrorAction newAction)
           
 CharsetEncoder onUnmappableCharacter(CodingErrorAction newAction)
           
 byte[] replacement()
           
 CharsetEncoder replaceWith(byte[] newReplacement)
           
 CharsetEncoder reset()
           
 CodingErrorAction unmappableCharacterAction()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)
                        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()