java.io.InputStream - read Strings separated by whitespaces

From: Angus Parvis (angusparvis_at_spamyourself.gmx.at)
Date: 11/02/03


Date: Sun, 02 Nov 2003 20:51:02 GMT

I want to read Strings from the java.io.InputStream System.in. Like
java.io.BufferedReader.readLn() reads from the Stream line-by-line i
want to ready word-by-word, separated by whitespaces.

I already got the advice to use a java.io.StreamTokenizer. But i'm new
to Java and, though trying to apply it to my problem i couldn't solve
the problem. I have to write the program for my studies an have to
finish till tuesday. So please forgive my stupidity and *please* help
out with some code. Thank you very much.



Relevant Pages

  • Re: Character semantics for filenames (was: win32 reading wide filenames (unicode))
    ... DO WITH CHARACTERS ABOVE "\xFF". ... suspect, openworks on the supplied byte stream AS IS, discregarding ... Unocode inserts hints in strings. ... encoding to perl strings by readdir and from perl strings to the OS ...
    (comp.lang.perl.misc)
  • Re: XML::LibXML UTF-8 toString() -vs- nodeValue()
    ... Each character is a 32-bit value. ... You can do Regexps on *strings*, whether they are binary or text. ... You don't need regexps at all to parse XML. ... read the next block or line from the stream and append it to your ...
    (comp.lang.perl.misc)
  • Re: Optimizing a text statistics function
    ... I'd create one stream which reads through the file, ... to use strings which is less than ideal because they are immutable (I ... characters once they have been read from the StringBuffer) and therefore ... Neil Benn ...
    (comp.lang.python)
  • Re: streams, etc
    ... | connection between strings and streams is murky to me. ... as opposed to the extraction operator '>>', ... are extracting data from the stream. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Reading from a stream til EOF
    ... > stuff is about doing optimizations in a centralized form - however, ... stream buffers do two things: ... And reading strings is just another example: ...
    (comp.lang.cpp)

Loading