📜 ⬆️ ⬇️

Quick java input

Good day!
This article will be useful for application programmers or people who are fond of sports programming. She will tell you about fast data entry in the Java language.

I often solve the problem on the site www.spoj.pl and sometimes I encounter problems with java speed. This mainly concerns rather slow data entry, for some tasks even the StreamTokenizer is not suitable.
To this end, I wrote a class that reads data byte by byte from the stream and converts it into numbers or strings. As it turned out, this class works several times faster than scanf () in C ++. I give his code below:
Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  1. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  2. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  3. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  4. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  5. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  6. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  7. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  8. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  9. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  10. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  11. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  12. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  13. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  14. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  15. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  16. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  17. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  18. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  19. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  20. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  21. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  22. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  23. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  24. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  25. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  26. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  27. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  28. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  29. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  30. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  31. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  32. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  33. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  34. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  35. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  36. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  37. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  38. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  39. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  40. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  41. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  42. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  43. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  44. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  45. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  46. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  47. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  48. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  49. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  50. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  51. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  52. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  53. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  54. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  55. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  56. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  57. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  58. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  59. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  60. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  61. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  62. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  63. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  64. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  65. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  66. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  67. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  68. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  69. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  70. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  71. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  72. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }
  73. Copy Source | Copy HTML import java.io. DataInputStream ; import java.io.InputStream; class Parser { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din; private byte [] buffer; private int bufferPointer, bytesRead; public Parser (InputStream in ) { din = new DataInputStream ( in ); buffer = new byte [BUFFER_SIZE]; bufferPointer = bytesRead = 0 ; } public String nextString( int maxSize) { byte [] ch = new byte [maxSize]; int point = 0 ; try { byte c = read(); while (c == ' ' || c == '\n' || c== '\r' ) c = read(); while (c != ' ' && c != '\n' && c!= '\r' ) { ch[point++] = c; c = read(); } } catch ( Exception e) {} return new String (ch, 0 ,point); } public int nextInt() { int ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } public long nextLong() { long ret = 0 ; boolean neg; try { byte c = read(); while (c <= ' ' ) c = read(); neg = c == '-' ; if (neg) c = read(); do { ret = ret * 10 + c - '0' ; c = read(); } while (c > ' ' ); if (neg) return -ret; } catch ( Exception e) {} return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0 , BUFFER_SIZE); } catch ( Exception e) {} if (bytesRead == - 1 ) buffer[ 0 ] = - 1 ; } private byte read() { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } }

You can check or compare the data entry rate at the INTEST task.

')

Source: https://habr.com/ru/post/91283/


All Articles