byte[] inflate(DfsReader ctx, long pos, int len) throws IOException, DataFormatException { byte[] dstbuf; try { dstbuf = new byte[len]; } catch (OutOfMemoryError noMemory) { return null; // Caller will switch to large object streaming. } Inflater inf = ctx.inflater(); pos += setInput(pos, inf); for (int dstoff = 0;;) { int n = inf.inflate(dstbuf, dstoff, dstbuf.length - dstoff); dstoff += n; if (inf.finished()) return dstbuf; if (inf.needsInput()) pos += setInput(pos, inf); else if (n == 0) throw new DataFormatException(); } }
@Override public ObjectStream openStream() throws IOException { @SuppressWarnings("resource") // Explicitly closed below final DfsReader ctx = db.newReader(); if (srcPack != packKey) { try { // Post DfsInserter.flush() use the normal code path. // The newly created pack is registered in the cache. return ctx.open(id, type).openStream(); } finally { ctx.close(); } } int bufsz = 8192; final Inflater inf = ctx.inflater(); return new ObjectStream.Filter(type, size, new BufferedInputStream(new InflaterInputStream( new ReadBackStream(pos), inf, bufsz), bufsz)) { @Override public void close() throws IOException { ctx.close(); super.close(); } }; }
new InflaterInputStream(packIn, packIn.ctx.inflater(), bufsz), bufsz); return new ObjectStream.Filter(type, size, in);
Inflater inf = ctx.inflater(); byte[] tmp = new byte[1024]; if (quickCopy != null) {
byte[] inflate(DfsReader ctx, long pos, int len) throws IOException, DataFormatException { byte[] dstbuf; try { dstbuf = new byte[len]; } catch (OutOfMemoryError noMemory) { return null; // Caller will switch to large object streaming. } Inflater inf = ctx.inflater(); pos += setInput(pos, inf); for (int dstoff = 0;;) { int n = inf.inflate(dstbuf, dstoff, dstbuf.length - dstoff); dstoff += n; if (inf.finished()) return dstbuf; if (inf.needsInput()) pos += setInput(pos, inf); else if (n == 0) throw new DataFormatException(); } }
byte[] inflate(DfsReader ctx, long pos, int len) throws IOException, DataFormatException { byte[] dstbuf; try { dstbuf = new byte[len]; } catch (OutOfMemoryError noMemory) { return null; // Caller will switch to large object streaming. } Inflater inf = ctx.inflater(); pos += setInput(pos, inf); for (int dstoff = 0;;) { int n = inf.inflate(dstbuf, dstoff, dstbuf.length - dstoff); dstoff += n; if (inf.finished()) return dstbuf; if (inf.needsInput()) pos += setInput(pos, inf); else if (n == 0) throw new DataFormatException(); } }
@Override public ObjectStream openStream() throws IOException { final DfsReader ctx = new DfsReader(db); if (srcPack != packKey) { try { // Post DfsInserter.flush() use the normal code path. // The newly created pack is registered in the cache. return ctx.open(id, type).openStream(); } finally { ctx.close(); } } int bufsz = 8192; final Inflater inf = ctx.inflater(); return new ObjectStream.Filter(type, size, new BufferedInputStream(new InflaterInputStream( new ReadBackStream(pos), inf, bufsz), bufsz)) { @Override public void close() throws IOException { ctx.close(); super.close(); } }; }
@Override public ObjectStream openStream() throws IOException { @SuppressWarnings("resource") // Explicitly closed below final DfsReader ctx = db.newReader(); if (srcPack != packKey) { try { // Post DfsInserter.flush() use the normal code path. // The newly created pack is registered in the cache. return ctx.open(id, type).openStream(); } finally { ctx.close(); } } int bufsz = 8192; final Inflater inf = ctx.inflater(); return new ObjectStream.Filter(type, size, new BufferedInputStream(new InflaterInputStream( new ReadBackStream(pos), inf, bufsz), bufsz)) { @Override public void close() throws IOException { ctx.close(); super.close(); } }; }
new InflaterInputStream(packIn, packIn.ctx.inflater(), bufsz), bufsz); return new ObjectStream.Filter(type, size, in);
new InflaterInputStream(in, ctx.inflater(), bufsz), bufsz); return new ObjectStream.Filter(type, size, in);
Inflater inf = ctx.inflater(); byte[] tmp = new byte[1024]; if (quickCopy != null) {
Inflater inf = ctx.inflater(); byte[] tmp = new byte[1024]; if (quickCopy != null) {