ReaderImpl now maintains either one or two bytes of lookahead,

depending on the value of the first byte, so that an object's initial
tag is included in the data seen by the ObjectReader. Digests and
signatures can therefore be calculated over objects by their readers
without any risk of ambiguity.
This commit is contained in:
akwizgran
2011-07-22 17:39:59 +01:00
parent b5220b096a
commit a573e87c04
16 changed files with 244 additions and 200 deletions

View File

@@ -45,9 +45,7 @@ public class StringUtils {
for(int i = 0, j = 0; i < len; i += 2, j++) {
int high = hexDigitToInt(hex.charAt(i));
int low = hexDigitToInt(hex.charAt(i + 1));
int b = (high << 4) + low;
if(b > 127) b -= 256;
bytes[j] = (byte) b;
bytes[j] = (byte) ((high << 4) + low);
}
return bytes;
}