Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DataInputStream: method readLine() is deprecated. (What's the alternative?)

800340Jan 23 2007 — edited Jan 25 2007
Hi there,

I have a DataInputStream object (code below). The code works great but I get a warning message below the code: dis.readLine()

The method readLine() from the type DataInputStream is deprecated

does anyone have an alternative to eliminate the warning?
 

DataInputStream dis = null; 
String line = null;
//read
File f = new File(inputFolder+"/"+inputFileName); 
FileInputStream fis = new FileInputStream(f); 
BufferedInputStream bis = new BufferedInputStream(fis); 
dis = new DataInputStream(bis);  
.
.
.
while ( (line=dis.readLine()) != null ) 
{     

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2007
Added on Jan 23 2007
3 comments
6,116 views