Refining Code
int a = System.in.read(p1); // returns the number of bytes read
String p2 = new String(p1,0,a); //build string from byte array
// System.out.println(p2); // check to see if all goes well
StringTokenizer st1 = new StringTokenizer(p2);
while (st1.hasMoreTokens()){