Examples of DeltaEncoder


Examples of org.eclipse.jgit.internal.storage.pack.DeltaEncoder

    a.setOffset(pack.length());
    objectHeader(pack, Constants.OBJ_BLOB, base.length);
    deflate(pack, base);

    ByteArrayOutputStream tmp = new ByteArrayOutputStream();
    DeltaEncoder de = new DeltaEncoder(tmp, base.length, 3L << 30);
    de.copy(0, 1);
    byte[] delta = tmp.toByteArray();
    b.setOffset(pack.length());
    objectHeader(pack, Constants.OBJ_REF_DELTA, delta.length);
    idA.copyRawTo(pack);
    deflate(pack, delta);
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.pack.DeltaEncoder

    return r;
  }

  private static byte[] delta(byte[] base, byte[] dest) throws IOException {
    ByteArrayOutputStream tmp = new ByteArrayOutputStream();
    DeltaEncoder de = new DeltaEncoder(tmp, base.length, dest.length);
    de.insert(dest, 0, 1);
    de.copy(1, base.length - 1);
    return tmp.toByteArray();
  }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.pack.DeltaEncoder

  @Before
  public void setUp() throws Exception {
    actDeltaBuf = new ByteArrayOutputStream();
    expDeltaBuf = new ByteArrayOutputStream();
    expDeltaEnc = new DeltaEncoder(expDeltaBuf, 0, 0);
    dstBuf = new ByteArrayOutputStream();
  }
View Full Code Here

Examples of org.eclipse.jgit.storage.pack.DeltaEncoder

    Arrays.fill(data0, (byte) 0xf3);
    ObjectId id0 = fmt.idFor(Constants.OBJ_BLOB, data0);

    byte[] data3 = rng.nextBytes(ObjectLoader.STREAM_THRESHOLD + 5);
    ByteArrayOutputStream tmp = new ByteArrayOutputStream();
    DeltaEncoder de = new DeltaEncoder(tmp, data0.length, data3.length);
    de.insert(data3, 0, data3.length);
    byte[] delta3 = tmp.toByteArray();
    assertTrue(delta3.length > ObjectLoader.STREAM_THRESHOLD);

    TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(64 * 1024);
    packHeader(pack, 2);
View Full Code Here

Examples of org.eclipse.jgit.storage.pack.DeltaEncoder

    return r;
  }

  private byte[] delta(byte[] base, byte[] dest) throws IOException {
    ByteArrayOutputStream tmp = new ByteArrayOutputStream();
    DeltaEncoder de = new DeltaEncoder(tmp, base.length, dest.length);
    de.insert(dest, 0, 1);
    de.copy(1, base.length - 1);
    return tmp.toByteArray();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.