void discardUntilEnd() throws IOException { for (;;) { int n = readLength(); if (n == 0) { break; } IO.skipFully(in, n - 4); } }
private void inflateAndSkip(Source src, long inflatedSize) throws IOException { try (InputStream inf = inflate(src, inflatedSize)) { IO.skipFully(inf, inflatedSize); } }
private void sync() throws IOException { packDigest.update(buf, 0, bOffset); onStoreStream(buf, 0, bOffset); if (expectDataAfterPackFooter) { if (bAvail > 0) { in.reset(); IO.skipFully(in, bOffset); bAvail = 0; } in.mark(buf.length); } else if (bAvail > 0) System.arraycopy(buf, bOffset, buf, 0, bAvail); bBase += bOffset; bOffset = 0; }
private String readLine(byte[] hdrbuf) throws IOException { StringBuilder line = new StringBuilder(); boolean done = false; while (!done) { bin.mark(hdrbuf.length); final int cnt = bin.read(hdrbuf); int lf = 0; while (lf < cnt && hdrbuf[lf] != '\n') lf++; bin.reset(); IO.skipFully(bin, lf); if (lf < cnt && hdrbuf[lf] == '\n') { IO.skipFully(bin, 1); done = true; } line.append(RawParseUtils.decode(UTF_8, hdrbuf, 0, lf)); } return line.toString(); }
private void readPackFooter() throws IOException { sync(); final byte[] actHash = packDigest.digest(); final int c = fill(Source.INPUT, 20); final byte[] srcHash = new byte[20]; System.arraycopy(buf, c, srcHash, 0, 20); use(20); if (bAvail != 0 && !expectDataAfterPackFooter) throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(buf[bOffset] & 0xff))); //$NON-NLS-1$ if (isCheckEofAfterPackFooter()) { int eof = in.read(); if (0 <= eof) throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(eof))); //$NON-NLS-1$ } else if (bAvail > 0 && expectDataAfterPackFooter) { in.reset(); IO.skipFully(in, bOffset); } if (!Arrays.equals(actHash, srcHash)) throw new CorruptObjectException( JGitText.get().corruptObjectPackfileChecksumIncorrect); onPackFooter(srcHash); }
IO.skipFully(in, p); in = buffer(inflate(in, size, id));
final int padLen = expLen - actLen - skipped; if (padLen > 0) { IO.skipFully(in, padLen); md.update(nullpad, 0, padLen);
limit = -1; try { IO.skipFully(in, n); } catch (IOException e) {
private void inflateAndSkip(final Source src, final long inflatedSize) throws IOException { final InputStream inf = inflate(src, inflatedSize); IO.skipFully(inf, inflatedSize); inf.close(); }
private void inflateAndSkip(Source src, long inflatedSize) throws IOException { try (InputStream inf = inflate(src, inflatedSize)) { IO.skipFully(inf, inflatedSize); } }
void discardUntilEnd() throws IOException { for (;;) { int n = readLength(); if (n == 0) { break; } IO.skipFully(in, n - 4); } }
void discardUntilEnd() throws IOException { for (;;) { int n = readLength(); if (n == 0) { break; } IO.skipFully(in, n - 4); } }
private String readLine(byte[] hdrbuf) throws IOException { StringBuilder line = new StringBuilder(); boolean done = false; while (!done) { bin.mark(hdrbuf.length); final int cnt = bin.read(hdrbuf); int lf = 0; while (lf < cnt && hdrbuf[lf] != '\n') lf++; bin.reset(); IO.skipFully(bin, lf); if (lf < cnt && hdrbuf[lf] == '\n') { IO.skipFully(bin, 1); done = true; } line.append(RawParseUtils.decode(UTF_8, hdrbuf, 0, lf)); } return line.toString(); }
private String readLine(final byte[] hdrbuf) throws IOException { StringBuilder line = new StringBuilder(); boolean done = false; while (!done) { bin.mark(hdrbuf.length); final int cnt = bin.read(hdrbuf); int lf = 0; while (lf < cnt && hdrbuf[lf] != '\n') lf++; bin.reset(); IO.skipFully(bin, lf); if (lf < cnt && hdrbuf[lf] == '\n') { IO.skipFully(bin, 1); done = true; } line.append(RawParseUtils.decode(Constants.CHARSET, hdrbuf, 0, lf)); } return line.toString(); }
private void sync() throws IOException { packDigest.update(buf, 0, bOffset); onStoreStream(buf, 0, bOffset); if (expectDataAfterPackFooter) { if (bAvail > 0) { in.reset(); IO.skipFully(in, bOffset); bAvail = 0; } in.mark(buf.length); } else if (bAvail > 0) System.arraycopy(buf, bOffset, buf, 0, bAvail); bBase += bOffset; bOffset = 0; }
private void sync() throws IOException { packDigest.update(buf, 0, bOffset); onStoreStream(buf, 0, bOffset); if (expectDataAfterPackFooter) { if (bAvail > 0) { in.reset(); IO.skipFully(in, bOffset); bAvail = 0; } in.mark(buf.length); } else if (bAvail > 0) System.arraycopy(buf, bOffset, buf, 0, bAvail); bBase += bOffset; bOffset = 0; }
IO.skipFully(in, p); Inflater inf = wc.inflater(); InputStream zIn = inflate(in, inf);
private void readPackFooter() throws IOException { sync(); final byte[] actHash = packDigest.digest(); final int c = fill(Source.INPUT, 20); final byte[] srcHash = new byte[20]; System.arraycopy(buf, c, srcHash, 0, 20); use(20); if (bAvail != 0 && !expectDataAfterPackFooter) throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(buf[bOffset] & 0xff))); //$NON-NLS-1$ if (isCheckEofAfterPackFooter()) { int eof = in.read(); if (0 <= eof) throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(eof))); //$NON-NLS-1$ } else if (bAvail > 0 && expectDataAfterPackFooter) { in.reset(); IO.skipFully(in, bOffset); } if (!Arrays.equals(actHash, srcHash)) throw new CorruptObjectException( JGitText.get().corruptObjectPackfileChecksumIncorrect); onPackFooter(srcHash); }
private void readPackFooter() throws IOException { sync(); final byte[] actHash = packDigest.digest(); final int c = fill(Source.INPUT, 20); final byte[] srcHash = new byte[20]; System.arraycopy(buf, c, srcHash, 0, 20); use(20); if (bAvail != 0 && !expectDataAfterPackFooter) throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(buf[bOffset] & 0xff))); //$NON-NLS-1$ if (isCheckEofAfterPackFooter()) { int eof = in.read(); if (0 <= eof) throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(eof))); //$NON-NLS-1$ } else if (bAvail > 0 && expectDataAfterPackFooter) { in.reset(); IO.skipFully(in, bOffset); } if (!Arrays.equals(actHash, srcHash)) throw new CorruptObjectException( JGitText.get().corruptObjectPackfileChecksumIncorrect); onPackFooter(srcHash); }