Classes derived from Reader and Writer take locale information when converting between Unicode and other character systems. : Stream « File « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » File » Stream 
9.3.5.Classes derived from Reader and Writer take locale information when converting between Unicode and other character systems.
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;

public class MainClass {
  public static void main(String[] argv) {
    try {
      FileOutputStream fos = new FileOutputStream("sometext.txt");
      OutputStreamWriter osw = new OutputStreamWriter(fos, "ISO8859-8");
      // various write operations go here
      osw.close();
    catch (UnsupportedEncodingException ee) {
      System.out.println("Encoding ISO8859-8 not supported");
    catch (IOException ie) {
      System.out.println(ie);
    }

  }
}
9.3.Stream
9.3.1.InputStream and OutputStream
9.3.2.Low-Level Streams: FileInputStream
9.3.3.A filter connects to an InputStream or OutputStream and performs some transformation on the data
9.3.4.Construct a chain of DataOutputStream, BufferedOutputStream and FileOutputStream
9.3.5.Classes derived from Reader and Writer take locale information when converting between Unicode and other character systems.
9.3.6.A small input chain between FileInputStream and DataInputStream
9.3.7.Input chain between FileOutputStream and DataOutputStream
9.3.8.Using FileInputStream, FileOutputStream, and File classes.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.