FileDocCategorySizeDatePackage
OpenFileByName.javaAPI DocExample357Wed Mar 07 16:25:12 GMT 2001None

OpenFileByName.java

import java.io.*;
public class OpenFileByName {
	public static void main(String[] args) throws IOException {
		BufferedReader is = new BufferedReader(new FileReader("myFile.txt"));
		BufferedOutputStream bytesOut = new BufferedOutputStream(
			new FileOutputStream("bytes.dat"));

		// Code here to read from is, write to bytesOut

		bytesOut.close();
	}
}