public int read(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (rangePosition >= length) { close(); return -1; } int elen = Math.min(len, length - rangePosition); raf.readFully(b, off, elen); rangePosition += elen; return elen; }
public int read(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (rangePosition >= length) { close(); return -1; } int elen = Math.min(len, length - rangePosition); raf.readFully(b, off, elen); rangePosition += elen; return elen; }
public int read(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (rangePosition >= length) { close(); return -1; } int elen = Math.min(len, length - rangePosition); raf.readFully(b, off, elen); rangePosition += elen; return elen; }