- }\r
- \r
- /**\r
- * Get next byte\r
- * @return 0..255 or -1 on end of file\r
- * @throws IOException\r
- */\r
- int _read()\r
- throws IOException\r
- {\r
- int value = is.read();\r
- if (value==-1) return -1;\r
- position++; \r
- return value & 0xff;\r
- } \r
- \r
- public final String readLine() throws IOException {\r
- StringBuffer input = new StringBuffer();\r
- int c = -1;\r
- boolean eol = false;\r
-\r
- while (!eol) {\r
- switch (c = _read()) {\r
- case -1:\r
- case '\n':\r
- eol = true;\r
- break;\r
- case '\r':\r
- eol = true;\r
-// long cur = position();\r
-// if ((_read()) != '\n') {\r
-// position=cur;\r
-// }\r
- break;\r
- default:\r
- input.append((char)c);\r
- break;\r
- }\r
- }\r
-\r
- if ((c == -1) && (input.length() == 0)) {\r
- return null;\r
- }\r
- return input.toString();\r
- } \r
+ }
+
+ /**
+ * Get next byte
+ * @return 0..255 or -1 on end of file
+ * @throws IOException
+ */
+ int _read()
+ throws IOException
+ {
+ int value = is.read();
+ if (value==-1) return -1;
+ position++;
+ return value & 0xff;
+ }
+
+ public final String readLine() throws IOException {
+ StringBuffer input = new StringBuffer();
+ int c = -1;
+ boolean eol = false;
+
+ while (!eol) {
+ switch (c = _read()) {
+ case -1:
+ case '\n':
+ eol = true;
+ break;
+ case '\r':
+ eol = true;
+// long cur = position();
+// if ((_read()) != '\n') {
+// position=cur;
+// }
+ break;
+ default:
+ input.append((char)c);
+ break;
+ }
+ }
+
+ if ((c == -1) && (input.length() == 0)) {
+ return null;
+ }
+ return input.toString();
+ }