()
| 114 | } |
| 115 | |
| 116 | public String readLine() throws IOException { |
| 117 | int c = read(); |
| 118 | if (c < 0) { |
| 119 | return null; |
| 120 | } else if (c == '\n') { |
| 121 | return ""; |
| 122 | } |
| 123 | StringBuilder builder = new StringBuilder(); |
| 124 | for (;;) { |
| 125 | builder.append((char)c); |
| 126 | c = read(); |
| 127 | if (c < 0 || c == '\n') { |
| 128 | return builder.toString(); |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | public void close() throws IOException { |
| 134 | in.close(); |