Reading a File:
/*
* FileInputDemo
* Demonstrates FileInputStream and
* DataInputStream
*/
import java.io.DataInputStream;
import java.io.FileInputStream;
public class FileInputDemo { public static void main(String args[]) {
// args.length is equivalent to argc in C
if (args.length == 1) { try {
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream(args[0]);
// Convert our input [...]
Filed under: Scripts, java | Tagged: bufferedreader, datainputstearm, Exception, file, fileinputstream, FileOutputStream, FileReader, getproperty, java, read, readLine, write | Leave a Comment »
