/** * Reads one <code>byte</code> from this input stream. * * @return the byte as an integer in the range 0 to 255. Returns -1 if EOF has been reached. * @throws IOException * if an I/O error occurs. */ @Override public int read() throws IOException { int r = read(singleByte, 0, 1); while (r == 0) { r = read(singleByte, 0, 1); } if (r > 0) { final byte b = singleByte[0]; return b < 0 ? 256 + b : b; } return EOF; }
/** * {@inheritDoc} * * @throws IllegalArgumentException if the provided skip length is negative * @since 1.7 */ @Override public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("Negative skip length: " + n); } // skip in chunks of 512 bytes final byte[] b = new byte[512]; long todo = n; while (todo > 0) { int len = (int) Math.min(b.length, todo); len = this.read(b, 0, len); if (len == EOF) { break; } todo -= len; } return n - todo; } }
/** * Reads one <code>byte</code> from this input stream. * * @return the byte as an integer in the range 0 to 255. Returns -1 if EOF has been reached. * @throws IOException * if an I/O error occurs. */ @Override public int read() throws IOException { int r = read(singleByte, 0, 1); while (r == 0) { r = read(singleByte, 0, 1); } if (r > 0) { final byte b = singleByte[0]; return b < 0 ? 256 + b : b; } return EOF; }
/** * Reads one <code>byte</code> from this input stream. * * @return the byte as an integer in the range 0 to 255. Returns -1 if EOF has been reached. * @throws IOException * if an I/O error occurs. */ @Override public int read() throws IOException { int r = read(singleByte, 0, 1); while (r == 0) { r = read(singleByte, 0, 1); } if (r > 0) { final byte b = singleByte[0]; return b < 0 ? 256 + b : b; } return EOF; }
/** * Reads one <code>byte</code> from this input stream. * * @return the byte as an integer in the range 0 to 255. Returns -1 if EOF has been reached. * @throws IOException * if an I/O error occurs. */ @Override public int read() throws IOException { int r = read(singleByte, 0, 1); while (r == 0) { r = read(singleByte, 0, 1); } if (r > 0) { final byte b = singleByte[0]; return b < 0 ? 256 + b : b; } return EOF; }
/** * Reads one <code>byte</code> from this input stream. * * @return the byte as an integer in the range 0 to 255. Returns -1 if EOF has been reached. * @throws IOException * if an I/O error occurs. */ @Override public int read() throws IOException { int r = read(singleByte, 0, 1); while (r == 0) { r = read(singleByte, 0, 1); } if (r > 0) { final byte b = singleByte[0]; return b < 0 ? 256 + b : b; } return EOF; }
/** * Reads one <code>byte</code> from this input stream. * * @return the byte as an integer in the range 0 to 255. Returns -1 if EOF has been reached. * @throws IOException * if an I/O error occurs. */ @Override public int read() throws IOException { int r = read(singleByte, 0, 1); while (r == 0) { r = read(singleByte, 0, 1); } if (r > 0) { final byte b = singleByte[0]; return b < 0 ? 256 + b : b; } return EOF; }
/** * {@inheritDoc} * * @throws IllegalArgumentException if the provided skip length is negative * @since 1.7 */ @Override public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("Negative skip length: " + n); } // skip in chunks of 512 bytes final byte[] b = new byte[512]; long todo = n; while (todo > 0) { int len = (int) Math.min(b.length, todo); len = this.read(b, 0, len); if (len == EOF) { break; } todo -= len; } return n - todo; } }
/** * {@inheritDoc} * * @throws IllegalArgumentException if the provided skip length is negative * @since 1.7 */ @Override public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("Negative skip length: " + n); } // skip in chunks of 512 bytes final byte[] b = new byte[512]; long todo = n; while (todo > 0) { int len = (int) Math.min(b.length, todo); len = this.read(b, 0, len); if (len == EOF) { break; } todo -= len; } return n - todo; } }
/** * {@inheritDoc} * * @throws IllegalArgumentException if the provided skip length is negative * @since 1.7 */ @Override public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("Negative skip length: " + n); } // skip in chunks of 512 bytes final byte[] b = new byte[512]; long todo = n; while (todo > 0) { int len = (int) Math.min(b.length, todo); len = this.read(b, 0, len); if (len == EOF) { break; } todo -= len; } return n - todo; } }
/** * {@inheritDoc} * * @throws IllegalArgumentException if the provided skip length is negative * @since 1.7 */ @Override public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("Negative skip length: " + n); } // skip in chunks of 512 bytes final byte[] b = new byte[512]; long todo = n; while (todo > 0) { int len = (int) Math.min(b.length, todo); len = this.read(b, 0, len); if (len == EOF) { break; } todo -= len; } return n - todo; } }
/** * {@inheritDoc} * * @throws IllegalArgumentException if the provided skip length is negative * @since 1.7 */ @Override public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("Negative skip length: " + n); } // skip in chunks of 512 bytes final byte[] b = new byte[512]; long todo = n; while (todo > 0) { int len = (int) Math.min(b.length, todo); len = this.read(b, 0, len); if (len == EOF) { break; } todo -= len; } return n - todo; } }