Writing ISO Latin-1 Encoded Data - Java File Path IO

Java examples for File Path IO:Text File

Description

Writing ISO Latin-1 Encoded Data

Demo Code

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

public class Main {

  public void main(String[] argv) {
    try {/*w  w  w  .  jav  a 2 s  .  c  om*/
      Writer out = new BufferedWriter(new OutputStreamWriter(
          new FileOutputStream("outfilename"), "8859_1"));
      out.write("aString");
      out.close();
    } catch (UnsupportedEncodingException e) {
    } catch (IOException e) {
    }
  }
}

Related Tutorials