/** {@inheritDoc} */ public int read() throws IOException { return byteInput.read(); }
/** {@inheritDoc} */ public long skip(final long n) throws IOException { return byteInput.skip(n); }
/** {@inheritDoc} */ public int available() throws IOException { return byteInput.available(); }
/** {@inheritDoc} */ public void close() throws IOException { final ByteInput byteInput = this.byteInput; if (byteInput != null) byteInput.close(); }
/** {@inheritDoc} */ public void close() throws IOException { byteInput.close(); } }
/** {@inheritDoc} */ public int read(final byte[] b, final int off, final int len) throws IOException { return byteInput.read(b, off, len); }
@Override public long skip(long bytes) throws IOException { int readable = readable((int) bytes); if (readable > 0) { long i = input.skip(readable); read += i; return i; } else { throw EXCEPTION; } }
/** {@inheritDoc} */ public int available() throws IOException { return limit - position + byteInput.available(); }
/** {@inheritDoc} */ public void close() throws IOException { byteInput.close(); } }
/** {@inheritDoc} */ public int read(final byte[] b) throws IOException { return byteInput.read(b); }
@Override public long skip(long bytes) throws IOException { int readable = readable((int) bytes); if (readable > 0) { long i = input.skip(readable); read += i; return i; } else { throw EXCEPTION; } }
@Override public int available() throws IOException { return readable(input.available()); }
/** {@inheritDoc} */ public void close() throws IOException { final ByteInput byteInput = this.byteInput; if (byteInput != null) byteInput.close(); }
/** {@inheritDoc} */ public int read() throws IOException { final int limit = this.limit; if (limit == -1) { return -1; } final int position = this.position; final byte[] buffer = this.buffer; if (position == limit) { if ((this.limit = byteInput.read(buffer)) == -1) { this.position = 0; return -1; } else { this.position = 1; return buffer[0] & 0xff; } } else { this.position = position + 1; return buffer[position] & 0xff; } }
/** {@inheritDoc} */ public long skip(final long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("n < 0"); } final int limit = this.limit; if (limit == -1) { return 0L; } final long remaining = limit - position; if (remaining > n) { position += (int) n; return n; } else { position = this.limit = 0; return byteInput.skip(n - remaining) + remaining; } }
@Override public int available() throws IOException { return readable(input.available()); }
/** {@inheritDoc} */ public void close() throws IOException { final ByteInput byteInput = this.byteInput; if (byteInput != null) byteInput.close(); }
@Override public int read(byte[] array, int offset, int length) throws IOException { int readable = readable(length); if (readable > 0) { int i = input.read(array, offset, readable); read += i; return i; } else { throw EXCEPTION; } }
/** {@inheritDoc} */ public int skipBytes(final int n) throws IOException { if (n < 0) { throw new IllegalArgumentException("n < 0"); } final int limit = this.limit; if (limit == -1) { return 0; } final int remaining = limit - position; if (remaining > n) { position += n; return n; } else { position = this.limit = 0; return (int) (byteInput.skip(n - remaining) + remaining); } }
@Override public int available() throws IOException { return readable(input.available()); }