/** * Convert a LongObjectId from hex characters. * * @param str * the string to read from. Must be 64 characters long. * @return the converted object id. */ public static LongObjectId fromString(String str) { if (str.length() != Constants.LONG_OBJECT_ID_STRING_LENGTH) throw new InvalidLongObjectIdException(str); return fromHexString(org.eclipse.jgit.lib.Constants.encodeASCII(str), 0); }
/** * Convert a LongObjectId from hex characters. * * @param str * the string to read from. Must be 64 characters long. * @return the converted object id. */ public static LongObjectId fromString(final String str) { if (str.length() != Constants.LONG_OBJECT_ID_STRING_LENGTH) throw new InvalidLongObjectIdException(str); return fromHexString(org.eclipse.jgit.lib.Constants.encodeASCII(str), 0); }
private void fromHexString(byte[] bs, int p) { try { w1 = RawParseUtils.parseHexInt64(bs, p); w2 = RawParseUtils.parseHexInt64(bs, p + 16); w3 = RawParseUtils.parseHexInt64(bs, p + 32); w4 = RawParseUtils.parseHexInt64(bs, p + 48); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidLongObjectIdException(bs, p, Constants.LONG_OBJECT_ID_STRING_LENGTH); } }
private void fromHexString(final byte[] bs, int p) { try { w1 = RawParseUtils.parseHexInt64(bs, p); w2 = RawParseUtils.parseHexInt64(bs, p + 16); w3 = RawParseUtils.parseHexInt64(bs, p + 32); w4 = RawParseUtils.parseHexInt64(bs, p + 48); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidLongObjectIdException(bs, p, Constants.LONG_OBJECT_ID_STRING_LENGTH); } }
private static final LongObjectId fromHexString(final byte[] bs, int p) { try { final long a = RawParseUtils.parseHexInt64(bs, p); final long b = RawParseUtils.parseHexInt64(bs, p + 16); final long c = RawParseUtils.parseHexInt64(bs, p + 32); final long d = RawParseUtils.parseHexInt64(bs, p + 48); return new LongObjectId(a, b, c, d); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidLongObjectIdException(bs, p, Constants.LONG_OBJECT_ID_STRING_LENGTH); } }
private static final LongObjectId fromHexString(byte[] bs, int p) { try { final long a = RawParseUtils.parseHexInt64(bs, p); final long b = RawParseUtils.parseHexInt64(bs, p + 16); final long c = RawParseUtils.parseHexInt64(bs, p + 32); final long d = RawParseUtils.parseHexInt64(bs, p + 48); return new LongObjectId(a, b, c, d); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidLongObjectIdException(bs, p, Constants.LONG_OBJECT_ID_STRING_LENGTH); } }
private static final AbbreviatedLongObjectId fromHexString(final byte[] bs, int ptr, final int end) { try { final long a = hexUInt64(bs, ptr, end); final long b = hexUInt64(bs, ptr + 16, end); final long c = hexUInt64(bs, ptr + 32, end); final long d = hexUInt64(bs, ptr + 48, end); return new AbbreviatedLongObjectId(end - ptr, a, b, c, d); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidLongObjectIdException(bs, ptr, end - ptr); } }
private static final AbbreviatedLongObjectId fromHexString(final byte[] bs, int ptr, final int end) { try { final long a = hexUInt64(bs, ptr, end); final long b = hexUInt64(bs, ptr + 16, end); final long c = hexUInt64(bs, ptr + 32, end); final long d = hexUInt64(bs, ptr + 48, end); return new AbbreviatedLongObjectId(end - ptr, a, b, c, d); } catch (ArrayIndexOutOfBoundsException e1) { throw new InvalidLongObjectIdException(bs, ptr, end - ptr); } }