String encoding = System.getProperty("file.encoding"); Charset cs = Charset.forName(encoding);
if(EncodingHelper.isISOLatin1(encoding_scheme)) { encodingName = "ISO8859_1"; encoder = null; return; }   try { if(encoding_scheme.equalsIgnoreCase("UnicodeBig") || encoding_scheme.equalsIgnoreCase("UTF-16") || encoding_scheme.equalsIgnoreCase("UTF16")) { encoding_scheme = "UTF-16BE"; out.write((byte)0xFE); out.write((byte)0xFF); } else if(encoding_scheme.equalsIgnoreCase("UnicodeLittle")){ encoding_scheme = "UTF-16LE"; out.write((byte)0xFF); out.write((byte)0xFE); } } catch(IOException ioe) { }  outputBuffer = CharBuffer.allocate(BUFFER_SIZE);  Charset cs = EncodingHelper.getCharset(encoding_scheme); if(cs == null) throw new UnsupportedEncodingException("Encoding "+encoding_scheme+ " unknown");
  public OutputStreamWriter (OutputStream out)  {    this.out = out;    outputBuffer = null;    try       {	String encoding = System.getProperty("file.encoding");	Charset cs = Charset.forName(encoding);	encoder = cs.newEncoder();	encodingName =  EncodingHelper.getOldCanonical(cs.name());      }     catch(RuntimeException e)       {	encoder = null; 	encodingName = "ISO8859_1";      }    if(encoder != null)      {	encoder.onMalformedInput(CodingErrorAction.REPLACE);	encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);	outputBuffer = CharBuffer.allocate(BUFFER_SIZE);      }  }