@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(); } }; }
@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(); } }; }
@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 int read() throws IOException { byte[] b = new byte[1]; int n = read(b); return n == 1 ? b[0] & 0xff : -1; }
@Override public int read() throws IOException { byte[] b = new byte[1]; int n = read(b); return n == 1 ? b[0] & 0xff : -1; }
@Override public int read() throws IOException { byte[] b = new byte[1]; int n = read(b); return n == 1 ? b[0] & 0xff : -1; }