I am writing a code to read Input from user by using BufferedInputStream, But as BufferedInputStream reads the bytes my program only read first byte and prints it. Is there any way I can read/store/print the whole input ( which will Integer ) besides just only reading first byte ?
import java.util.*;
import java.io.*;
class EnormousInputTest{
public static void main(String[] args)throws IOException {
BufferedInputStream bf = new BufferedInputStream(System.in) ;
try{
char c = (char)bf.read();
System.out.println(c);
}
finally{
bf.close();
}
}
}
OutPut:
[shadow@localhost codechef]$ java EnormousInputTest 5452 5
BufferedReader
instead? – Brainwash