Code example for CharsetEncoder

Methods: onMalformedInputonUnmappableCharacter

0
  public CharsetToBytesAdaptor(CharsetEncoder enc)
  { 
    encoder = enc;
    // Use default replacments on bad input so that we don't have to 
    // deal with errors. 
    encoder.onMalformedInput(CodingErrorAction.REPLACE);
    encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
  } 
 
  /** 
   * Return the encoder's name.  The backing Charset's name is 
   * returned. 
   * 
   * @return The name. 
   */ 
  public String getName()
  { 
    return EncodingHelper.getOldCanonical(encoder.charset().name());
  } 
 
  public int write (char[] inbuffer, int inpos, int inlength)