- private boolean read_data(Reader r) throws IOException {
- BufferedReader br = new BufferedReader(r);
- String s;
+ private String read_line(InputStream stream) throws IOException {
+ StringBuffer buffer = null;
+ int c;
+
+ for (;;) {
+ c = stream.read();
+ if (c == -1 && buffer == null)
+ return null;
+ if (buffer == null)
+ buffer = new StringBuffer();
+ if (c == -1 || c == '\n')
+ return buffer.toString();
+ buffer.append((char) c);
+ }
+ }
+
+ private boolean read_data(InputStream stream) throws IOException {
+ String s;