String s = "String I want to parse"; InputStream is = new ByteArrayInputStream(s.getBytes()); Reader r = new BufferedReader(new InputStreamReader(is)); StreamTokenizer tokenizer = new StreamTokenizer(r); // You can now use tokenizer
Programming Tips - Java: How can I use StreamTokenizer on a String?
Date: 2013feb5
Language: Java
Keywords: byte, stream, input, token, tokenizer
Q. Java: How can I use StreamTokenizer on a String?
A. Use ByteArrayInputStream to make an InputStream
and then convert that into a Reader: