return new CharsetEncoderICU(this,converterHandle[0]);
try{ return new CharsetEncoderICU(this,converterHandle[0], replacement); }catch(IllegalArgumentException ex){   replacement = (byte[])subByteMap.get(icuCanonicalName); if(replacement==null){ replacement = new byte[NativeConverter.getMinBytesPerChar(converterHandle[0])]; for(int i=0; i<replacement.length; i++){ replacement[i]= 0x3f; } } NativeConverter.setSubstitutionBytes(converterHandle[0], replacement, replacement.length);; return new CharsetEncoderICU(this,converterHandle[0], replacement); }
    public CharsetEncoder newEncoder(){        // the arrays are locals and not        // instance variables since the        // methods on this class need to         // be thread safe        long[] converterHandle = new long[1];        int ec = NativeConverter.openConverter(converterHandle, icuCanonicalName);        if(ErrorCode.isSuccess(ec)){            return new CharsetEncoderICU(this,converterHandle[0]);        }else{            throw ErrorCode.getException(ec);        }    } 