/** * Generate a delta sequence to recreate the result buffer. * <p> * There is no limit on the size of the delta sequence created. This is the * same as {@code encode(out, res, 0)}. * * @param out * stream to receive the delta instructions that can transform * this index's source buffer into {@code res}. This stream * should be buffered, as instructions are written directly to it * in small bursts. * @param res * the desired result buffer. The generated instructions will * recreate this buffer when applied to the source buffer stored * within this index. * @throws java.io.IOException * the output stream refused to write the instructions. */ public void encode(OutputStream out, byte[] res) throws IOException { encode(out, res, 0 /* no limit */); }
private TemporaryBuffer.Heap delta(ObjectToPack otp) throws IOException { DeltaIndex index = new DeltaIndex(buffer(otp.getDeltaBaseId())); byte[] res = buffer(otp); // We never would have proposed this pair if the delta would be // larger than the unpacked version of the object. So using it // as our buffer limit is valid: we will never reach it. // TemporaryBuffer.Heap delta = new TemporaryBuffer.Heap(res.length); index.encode(delta, res); return delta; }
/** * Generate a delta sequence to recreate the result buffer. * <p> * There is no limit on the size of the delta sequence created. This is the * same as {@code encode(out, res, 0)}. * * @param out * stream to receive the delta instructions that can transform * this index's source buffer into {@code res}. This stream * should be buffered, as instructions are written directly to it * in small bursts. * @param res * the desired result buffer. The generated instructions will * recreate this buffer when applied to the source buffer stored * within this index. * @throws IOException * the output stream refused to write the instructions. */ public void encode(OutputStream out, byte[] res) throws IOException { encode(out, res, 0 /* no limit */); }
/** * Generate a delta sequence to recreate the result buffer. * <p> * There is no limit on the size of the delta sequence created. This is the * same as {@code encode(out, res, 0)}. * * @param out * stream to receive the delta instructions that can transform * this index's source buffer into {@code res}. This stream * should be buffered, as instructions are written directly to it * in small bursts. * @param res * the desired result buffer. The generated instructions will * recreate this buffer when applied to the source buffer stored * within this index. * @throws java.io.IOException * the output stream refused to write the instructions. */ public void encode(OutputStream out, byte[] res) throws IOException { encode(out, res, 0 /* no limit */); }
? new ArrayStream(msz) : new TemporaryBuffer.Heap(msz); if (srcIndex.encode(delta, resBuf, msz)) selectDeltaBase(src, delta); } catch (IOException deltaTooBig) {
private TemporaryBuffer.Heap delta(ObjectToPack otp) throws IOException { DeltaIndex index = new DeltaIndex(buffer(otp.getDeltaBaseId())); byte[] res = buffer(otp); // We never would have proposed this pair if the delta would be // larger than the unpacked version of the object. So using it // as our buffer limit is valid: we will never reach it. // TemporaryBuffer.Heap delta = new TemporaryBuffer.Heap(res.length); index.encode(delta, res); return delta; }
private TemporaryBuffer.Heap delta(final ObjectToPack otp) throws IOException { DeltaIndex index = new DeltaIndex(buffer(otp.getDeltaBaseId())); byte[] res = buffer(otp); // We never would have proposed this pair if the delta would be // larger than the unpacked version of the object. So using it // as our buffer limit is valid: we will never reach it. // TemporaryBuffer.Heap delta = new TemporaryBuffer.Heap(res.length); index.encode(delta, res); return delta; }
? new ArrayStream(msz) : new TemporaryBuffer.Heap(msz); if (srcIndex.encode(delta, resBuf, msz)) selectDeltaBase(src, delta); } catch (IOException deltaTooBig) {
? new ArrayStream(msz) : new TemporaryBuffer.Heap(msz); if (srcIndex.encode(delta, resBuf, msz)) selectDeltaBase(src, delta); } catch (IOException deltaTooBig) {