[JGIT PATCH 07/12] Add overload of fromRaw() in MutableObjectId accepting int[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Marek Zawirski <marek.zawirski@xxxxxxxxx>
---
 .../src/org/spearce/jgit/lib/MutableObjectId.java  |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/MutableObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/MutableObjectId.java
index b23d36c..954380b 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/MutableObjectId.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/MutableObjectId.java
@@ -74,6 +74,35 @@ public class MutableObjectId extends AnyObjectId {
 	}
 
 	/**
+	 * Convert an ObjectId from binary representation expressed in integers.
+	 * 
+	 * @param ints
+	 *            the raw int buffer to read from. At least 5 integers must be
+	 *            available within this integers array.
+	 */
+	public void fromRaw(final int[] ints) {
+		fromRaw(ints, 0);
+	}
+
+	/**
+	 * Convert an ObjectId from binary representation expressed in integers.
+	 * 
+	 * @param ints
+	 *            the raw int buffer to read from. At least 5 integers after p
+	 *            must be available within this integers array.
+	 * @param p
+	 *            position to read the first integer of data from.
+	 * 
+	 */
+	public void fromRaw(final int[] ints, final int p) {
+		w1 = ints[p];
+		w2 = ints[p + 1];
+		w3 = ints[p + 2];
+		w4 = ints[p + 3];
+		w5 = ints[p + 4];
+	}
+
+	/**
 	 * Convert an ObjectId from hex characters (US-ASCII).
 	 * 
 	 * @param buf
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux