Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

To read a line, how to use InputStream instead of BufferReader ?  RSS feed

 
Lakshmi Ramachandran
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,
I have a document and I am generating an XML from that by extracting each line using BufferedReader. Now my requirement is to change this so that it uses an InputStream instead of a BufferedReader . The reason for this is to avoid a possible overflow with the BufferedReader.
Please help me out ASAP,as I am unable to read a line with the methods provided by InputStream.
Thanks in advance.
Regards,
Lakshmi
 
Lewin Chan
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that you don't want buffering, or any fancy stuff like that...

[This message has been edited by Marilyn deQueiroz (edited October 10, 2001).]
 
Alexandru Eduard Gitman
Greenhorn
Posts: 1
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TO use this code in a loop, for example to parse a hole file given by inputStream, you have to add a condition to the while loop, so it will be


and you can add the method
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!