File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

system.in.read()

 
Bron Czimes
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there
just a quick question. is there an alternative to system.in.read() if you want to read more than one character at a time, say, maybe a few words or something...???
thanks
bron
 
David Peterson
author
Ranch Hand
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read line-by-line with a BufferedReader.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You can wrap the System.in InputStream in a BufferedReader, which will allow you to read a line of text a time.
To begin to form a good understanding for how these fancy Streams and Readers work, I recommend reading the I/O Lesson of Sun's Java Tutorial.
[ May 09, 2004: Message edited by: Dirk Schreckmann ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic