File reading

How to read file contents write simple waynull
[60 byte] By [NAGAVANISRIa] at [2007-10-2 21:18:31]
# 1

import java.io.*;

public class read {

public static void main(String args[]) throws IOException {

String thisLine;

String[] fullText = new String[10];

int counter = 0;

FileInputStream fis = new FileInputStream("test.dat");

int c=0;

while((c=fis.read)!=-1)

{

System.out.println((char)c);

}

DataInputStream myInput = new DataInputStream(fis);

while ((thisLine = myInput.getchar()) != null) {

System.out.println(thisLine);

counter++;

fullText[counter] = thisLine;

}

}

}

premavathya at 2007-7-14 0:27:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...