hey guys i am workin on this code for 2 days but i was not able to succed due to lak of my experience. so pls help me out.
the code is
import javan.io.*; //a generated package purpose is explained below.
import java.io.*;
public class bufferedInput{
public bufferedInput(){
int count;
try{
BufferedInputString in = new BufferedInputString(new FileInputStream("/home/surya/data/WAMMAP2009120900.vtk"));
System.out.println("before while");
boolean EOF = false;
count=0;
System.out.println("just before while");
while(!EOF)
{
// System.out.println("workin");
if(count==1){
char c;
c=in.readChar();
System.out.println(c);
break;
}
count++;
}
in.close();
}
catch(FileNotFoundException e){
System.out.println(e);
} catch(IOException e){
System.out.println(e);
}
}
public static void main(String args[]){
new bufferedInput();
}
}
when i run this code it is givin me
before while
just before while
?
the explanation of BufferedInputString class in javan.io is explained as follows :-
Description: *
* This class is intended to speed up file *
* access time. This class works by reading *
* the file or part of the file into a byte *
* array and converted into a String. Then *
* the information (int, long, float, double, *
* and String) is retrieved from the String *
* through tokens. *
* The concept is that it is faster and more *
* effeicent to have one file access and then *
* process a byte array. Accessing the file *
* time and time again can be costly. *
* *
* This class is constructed just like *
* DataInputStream. **********************************
surya (:confused