I need reader a file in binary mode, who I do?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, August 19, 2002 09:28 AM

I need reade a file in binary mode.


File voFile = new File(vsPathFile);
BufferReader voReader = null;
try{
BufferReader(new FileReader(voFile));
}
catch(Exception e){
}

Re: I need reader a file in binary mode, who I do?

Posted By:   Alex_Kobyakov  
Posted On:   Tuesday, August 20, 2002 02:25 AM

You can try this:

File voFile = new File(vsPathFile);
BufferedReader voReader = null;
int len = 0;
char[] arr = new char[YOUR_LENGTH];
try{
voReader = new BufferedReader(new FileReader(voFile));
while ((len = voReader.read(arr)) != -1) {
//do what you will with array
}
} catch(Exception e){
e.printStackTrace();
}
About | Sitemap | Contact