Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding readLine()  RSS feed

 
Azam Bukhari
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any web site where i can get myself updated for the proper substitute of deprecated functions like readLine();

if there is not, can anyone reply me back for it's substitute

Azee
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which readLine ?
 
Azam Bukhari
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorrry it is :

DataInputStream
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, the API has this info in the javadoc comments for the deprecated method. Usually. In this case, the DataInputStream API says (in the readLine() section):
As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form:

    DataInputStream d = new DataInputStream(in);


with:

    BufferedReader d
             = new BufferedReader(new InputStreamReader(in));
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!