Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Help coderanch get a
new server
by contributing to the
fundraiser
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
I/O and Streams
EOF on System.in
Graeme Byers
Ranch Hand
Posts: 127
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The code below is from Ian Darwin's "Java Cookbook" page 151.
What key on Win XP do I hit to set inputLine = null ?
(carriage return is 0XD).
Thank you.
http://javacook.darwinsys.com/javasrc/io/CatStdin.java
import java.io.*; /** * Read and print, using BufferedReader from System.in, onto System.out */ public class CatStdin { public static void main(String[] av) { try { BufferedReader is = new BufferedReader(new InputStreamReader(System.in)); String inputLine; while ((inputLine = is.readLine()) != null) { System.out.println(inputLine); } is.close(); } catch (IOException e) { System.out.println("IOException: " + e); } } }
Campbell Ritchie
Marshal
Posts: 79642
380
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try ctrl-Z on Windows, some combination including ctrl-D on Mac or *nix.
Graeme Byers
Ranch Hand
Posts: 127
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thankyou , cntl-Z for Windows.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Head First Java Ready-Bake Code
Null pointer exception when trying to enter a blank for a response -- how to fix?
Help!!! I write the code it compiled but it can't run
URL and Severs(very Urgent)
For loop Pyramid Program
More...