I am trying to read from scanner with spaces, i want to read even the spaces. for example "john smith" to be read "john smith".
my code is as follow: when it gets to the space after john it just hangs and doesn't read any more. any help would be appreciated.
Scanner in = new Scanner(new InputStreamReader(sock.getInputStream()));
String userName = "";
while (in.hasNext()) {
userName.concat(in.next());
}
scanner.nextLine();i meanin.nextLine();