The java.io.FileWriter is useful to work with characters directly instead of bytes. All the Writer and the Reader classes in Java are treated as Character Streams.
java.io.FileWriter is sub class of OutputStreamWriter which contains the overloaded methods, write(int c), write(char[] c),write(char[] c, int start, int end). These methods help in writing data to a file. Note that here, the method is taking char[] instead of byte[] as in the FileOutputStream (FileOutputStream is a sub-class of OutputStream).
java.io.FileWriter is sub class of OutputStreamWriter which contains the overloaded methods, write(int c), write(char[] c),write(char[] c, int start, int end). These methods help in writing data to a file. Note that here, the method is taking char[] instead of byte[] as in the FileOutputStream (FileOutputStream is a sub-class of OutputStream).
No comments:
Post a Comment