- // Read in the whole of standard input in one go
- int nbytes = System.in.read(bytes);
- } catch (java.io.IOException ex) {
+ // read a single line of input
+ cql = buff.readLine();
+ if (cql == null) {
+ System.err.println("Can't read query from stdin");
+ System.exit(2);
+ return;
+ }
+ } catch (IOException ex) {