See the code fragments below:
StreamTokenizer t;
StringBufferInputStream aStream;
aStream = new StringBufferInputStream("one\ntwo three\tfour");
try {
t = new StreamTokenizer(aStream);
System.out.println("new tokenizer");
t.whitespaceChars(0,9);
t.wordChars(20, 0xff);
t.ordinaryChar('\n');
t.eolIsSignificant(false);
System.out.println("set wordChars");
t.nextToken();
System.out.println("toString() = " + t.toString() );
t.nextToken();
System.out.println("toString() = " + t.toString() );
StreamTokenizer t;
StringBufferInputStream aStream;
aStream = new StringBufferInputStream("one\ntwo three\tfour");
try {
t = new StreamTokenizer(aStream);
System.out.println("new tokenizer");
t.whitespaceChars(0,9);
t.wordChars(20, 0xff);
t.ordinaryChar('\n');
t.eolIsSignificant(false);
System.out.println("set wordChars");
t.nextToken();
System.out.println("toString() = " + t.toString() );
t.nextToken();
System.out.println("toString() = " + t.toString() );
- relates to
-
JDK-4022206 java.io.StreamTokenizer spec do not describe setting attributes clearly
- Closed
-
JDK-4022462 java.io.StreamTokenizer counts lines incorrectly if newline is made ordinary
- Closed
-
JDK-4104847 (spec) StreamTokizer.eolIsSignificant() should specify that it is dynamic
- Closed