Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static char[] read() throws Exception {
- char[] input;
- int buffercount = 1;
- char[] buffer = new char[buffercount];
- int counter = 0;
- while ((buffer[counter] = (char) System.in.read()) != '\r' && buffer[counter] != '\n') {
- counter++;
- buffercount++;
- }
- input = new char[counter];
- for (int i = 0; i < counter; i++)
- input[i] = buffer[i];
- return input;
- }
Add Comment
Please, Sign In to add comment