Example usage for org.eclipse.jgit.lib ObjectId copyRawTo

List of usage examples for org.eclipse.jgit.lib ObjectId copyRawTo

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib ObjectId copyRawTo.

Prototype

public void copyRawTo(byte[] b, int o) 

Source Link

Document

Copy this ObjectId to a byte array.

Usage

From source file:de.fkoeberle.autocommit.git.HashCacluatingDeltaVisitor.java

License:Open Source License

@Override
public void visitAddedFile(String path, ObjectId newObjectId) throws IOException {
    messageDigest.update(ADDED_FILE_MAGIC_WORD);
    messageDigest.update(path.getBytes());
    newObjectId.copyRawTo(buffer, 0);
    messageDigest.update(buffer);/*from  w  ww . j a va2  s .  c  o  m*/
}

From source file:de.fkoeberle.autocommit.git.HashCacluatingDeltaVisitor.java

License:Open Source License

@Override
public void visitRemovedFile(String path, ObjectId oldObjectId) throws IOException {
    messageDigest.update(REMOVED_FILE_MAGIC_WORD);
    messageDigest.update(path.getBytes());
    oldObjectId.copyRawTo(buffer, 0);
    messageDigest.update(buffer);//w w  w .ja v  a  2  s  . c o m
}

From source file:de.fkoeberle.autocommit.git.HashCacluatingDeltaVisitor.java

License:Open Source License

@Override
public void visitChangedFile(String path, ObjectId oldObjectId, ObjectId newObjectId) throws IOException {
    messageDigest.update(CHANGED_FILE_MAGIC_WORD);
    messageDigest.update(path.getBytes());
    oldObjectId.copyRawTo(buffer, 0);
    messageDigest.update(buffer);/*from ww w.j  ava 2s  .com*/
    newObjectId.copyRawTo(buffer, 0);
    messageDigest.update(buffer);
}