int read(long pos, byte[] dst, int ptr, int cnt) throws IOException { int r = 0; while (pos < currPos && r < cnt) { DfsBlock b = getOrLoadBlock(pos); int n = b.copy(pos, dst, ptr + r, cnt - r); pos += n; r += n; } if (currPos <= pos && r < cnt) { int s = (int) (pos - currPos); int n = Math.min(currPtr - s, cnt - r); System.arraycopy(currBuf, s, dst, ptr + r, n); r += n; } return r; }
private int setInput(long pos, Inflater inf) throws IOException, DataFormatException { if (pos < currPos) return getOrLoadBlock(pos).setInput(pos, inf); if (pos < currPos + currPtr) { int s = (int) (pos - currPos); int n = currPtr - s; inf.setInput(currBuf, s, n); return n; } throw new EOFException(JGitText.get().unexpectedEofInPack); }
int read(long pos, byte[] dst, int ptr, int cnt) throws IOException { int r = 0; while (pos < currPos && r < cnt) { DfsBlock b = getOrLoadBlock(pos); int n = b.copy(pos, dst, ptr + r, cnt - r); pos += n; r += n; } if (currPos <= pos && r < cnt) { int s = (int) (pos - currPos); int n = Math.min(currPtr - s, cnt - r); System.arraycopy(currBuf, s, dst, ptr + r, n); r += n; } return r; }
int read(long pos, byte[] dst, int ptr, int cnt) throws IOException { int r = 0; while (pos < currPos && r < cnt) { DfsBlock b = getOrLoadBlock(pos); int n = b.copy(pos, dst, ptr + r, cnt - r); pos += n; r += n; } if (currPos <= pos && r < cnt) { int s = (int) (pos - currPos); int n = Math.min(currPtr - s, cnt - r); System.arraycopy(currBuf, s, dst, ptr + r, n); r += n; } return r; }
private int setInput(long pos, Inflater inf) throws IOException, DataFormatException { if (pos < currPos) return getOrLoadBlock(pos).setInput(pos, inf); if (pos < currPos + currPtr) { int s = (int) (pos - currPos); int n = currPtr - s; inf.setInput(currBuf, s, n); return n; } throw new EOFException(JGitText.get().unexpectedEofInPack); }
private int setInput(long pos, Inflater inf) throws IOException, DataFormatException { if (pos < currPos) return getOrLoadBlock(pos).setInput(pos, inf); if (pos < currPos + currPtr) { int s = (int) (pos - currPos); int n = currPtr - s; inf.setInput(currBuf, s, n); return n; } throw new EOFException(DfsText.get().unexpectedEofInPack); }