@Override public int read() throws IOException { ensureBuffer(); if (maxOffset == 0) { return -1; } int ch = buffer[offset] & 0xFF; offset++; return ch; }
@Override public int read() throws IOException { ensureBuffer(); if (maxOffset == 0) { return -1; } int ch = buffer[offset] & 0xFF; offset++; return ch; }
@Override public int read() throws IOException { ensureBuffer(); if (maxOffset == 0) { return -1; } int ch = buffer[offset] & 0xFF; offset++; return ch; }
@Override public int read(byte[] buf, int ofs, int len) throws IOException { ensureBuffer(); if (maxOffset == 0) { return 0; } len = Math.min(len, remaining()); System.arraycopy(buffer, offset, buf, ofs, len); offset += len; return len; }
@Override public int read(byte[] buf, int ofs, int len) throws IOException { ensureBuffer(); if (maxOffset == 0) { return 0; } len = Math.min(len, remaining()); System.arraycopy(buffer, offset, buf, ofs, len); offset += len; return len; }
@Override public long skip(long c) throws IOException { ensureBuffer(); if (maxOffset == 0) { return 0; } int count = (c > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)c; int skip = Math.min(count, remaining()); offset += skip; return skip; }
@Override public int read(byte[] buf, int ofs, int len) throws IOException { ensureBuffer(); if (maxOffset == 0) { return 0; } len = Math.min(len, remaining()); System.arraycopy(buffer, offset, buf, ofs, len); offset += len; return len; }
@Override public long skip(long c) throws IOException { ensureBuffer(); if (maxOffset == 0) { return 0; } int count = (c > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)c; int skip = Math.min(count, remaining()); offset += skip; return skip; }
@Override public long skip(long c) throws IOException { ensureBuffer(); if (maxOffset == 0) { return 0; } int count = (c > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)c; int skip = Math.min(count, remaining()); offset += skip; return skip; }