void write(PackOutputStream out, long pos, int cnt) throws IOException { out.write(block, (int) (pos - start), cnt); }
private void writeDeltaObjectDeflate(PackOutputStream out, final ObjectToPack otp) throws IOException { writeBase(out, otp.getDeltaBase()); crc32.reset(); otp.setOffset(out.length()); DeltaCache.Ref ref = otp.popCachedDelta(); if (ref != null) { byte[] zbuf = ref.get(); if (zbuf != null) { out.writeHeader(otp, otp.getCachedSize()); out.write(zbuf); typeStats.cntDeltas++; typeStats.deltaBytes += out.length() - otp.getOffset(); return; } } try (TemporaryBuffer.Heap delta = delta(otp)) { out.writeHeader(otp, delta.length()); Deflater deflater = deflater(); deflater.reset(); DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater); delta.writeTo(dst, null); dst.finish(); } typeStats.cntDeltas++; typeStats.deltaBytes += out.length() - otp.getOffset(); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { int ptr = (int) (pos - start); out.write(array, ptr, cnt); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { final ByteBuffer s = buffer.slice(); s.position((int) (pos - start)); while (0 < cnt) { byte[] buf = out.getCopyBuffer(); int n = Math.min(cnt, buf.length); s.get(buf, 0, n); out.write(buf, 0, n); cnt -= n; } }
private void writeChecksum(PackOutputStream out) throws IOException { packcsum = out.getDigest(); out.write(packcsum); }
final void writeFileHeader(int version, long objectCount) throws IOException { System.arraycopy(PACK_SIGNATURE, 0, headerBuffer, 0, 4); NB.encodeInt32(headerBuffer, 4, version); NB.encodeInt32(headerBuffer, 8, (int) objectCount); write(headerBuffer, 0, 12); ofsDelta = packWriter.isDeltaBaseAsOffset(); }
int n = objectHeader(rawLength, OBJ_OFS_DELTA, headerBuffer); n = ofsDelta(count - b.getOffset(), headerBuffer, n); write(headerBuffer, 0, n); } else if (otp.isDeltaRepresentation()) { int n = objectHeader(rawLength, OBJ_REF_DELTA, headerBuffer); otp.getDeltaBaseId().copyRawTo(headerBuffer, n); write(headerBuffer, 0, n + 20); } else { int n = objectHeader(rawLength, otp.getType(), headerBuffer); write(headerBuffer, 0, n);
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { int ptr = (int) (pos - start); out.write(array, ptr, cnt); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { int ptr = (int) (pos - start); out.write(array, ptr, cnt); }
void write(PackOutputStream out, long pos, int cnt) throws IOException { out.write(block, (int) (pos - start), cnt); }
void write(PackOutputStream out, long pos, int cnt) throws IOException { out.write(block, (int) (pos - start), cnt); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { final ByteBuffer s = buffer.slice(); s.position((int) (pos - start)); while (0 < cnt) { byte[] buf = out.getCopyBuffer(); int n = Math.min(cnt, buf.length); s.get(buf, 0, n); out.write(buf, 0, n); cnt -= n; } }
private void writeChecksum(PackOutputStream out) throws IOException { packcsum = out.getDigest(); out.write(packcsum); }
private void writeChecksum(PackOutputStream out) throws IOException { packcsum = out.getDigest(); out.write(packcsum); }
@Override void write(PackOutputStream out, long pos, int cnt) throws IOException { final ByteBuffer s = buffer.slice(); s.position((int) (pos - start)); while (0 < cnt) { byte[] buf = out.getCopyBuffer(); int n = Math.min(cnt, buf.length); s.get(buf, 0, n); out.write(buf, 0, n); cnt -= n; } }
final void writeFileHeader(int version, long objectCount) throws IOException { System.arraycopy(PACK_SIGNATURE, 0, headerBuffer, 0, 4); NB.encodeInt32(headerBuffer, 4, version); NB.encodeInt32(headerBuffer, 8, (int) objectCount); write(headerBuffer, 0, 12); ofsDelta = packWriter.isDeltaBaseAsOffset(); }
final void writeFileHeader(int version, long objectCount) throws IOException { System.arraycopy(PACK_SIGNATURE, 0, headerBuffer, 0, 4); NB.encodeInt32(headerBuffer, 4, version); NB.encodeInt32(headerBuffer, 8, (int) objectCount); write(headerBuffer, 0, 12); ofsDelta = packWriter.isDeltaBaseAsOffset(); }