/** * Convert an ObjectId from hex characters (US-ASCII). * * @param buf * the US-ASCII buffer to read from. At least 40 bytes after * offset must be available within this byte array. * @param offset * position to read the first character from. * @return the converted object id. */ public static final ObjectId fromString(byte[] buf, int offset) { return fromHexString(buf, offset); }
/** * Convert an ObjectId from hex characters. * * @param str * the string to read from. Must be 40 characters long. * @return the converted object id. */ public static ObjectId fromString(String str) { if (str.length() != Constants.OBJECT_ID_STRING_LENGTH) { throw new InvalidObjectIdException(str); } return fromHexString(Constants.encodeASCII(str), 0); }
/** * Convert an ObjectId from hex characters (US-ASCII). * * @param buf * the US-ASCII buffer to read from. At least 40 bytes after * offset must be available within this byte array. * @param offset * position to read the first character from. * @return the converted object id. */ public static final ObjectId fromString(final byte[] buf, final int offset) { return fromHexString(buf, offset); }
/** * Convert an ObjectId from hex characters (US-ASCII). * * @param buf * the US-ASCII buffer to read from. At least 40 bytes after * offset must be available within this byte array. * @param offset * position to read the first character from. * @return the converted object id. */ public static final ObjectId fromString(byte[] buf, int offset) { return fromHexString(buf, offset); }
/** * Convert an ObjectId from hex characters. * * @param str * the string to read from. Must be 40 characters long. * @return the converted object id. */ public static ObjectId fromString(final String str) { if (str.length() != Constants.OBJECT_ID_STRING_LENGTH) { throw new InvalidObjectIdException(str); } return fromHexString(Constants.encodeASCII(str), 0); }
/** * Convert an ObjectId from hex characters. * * @param str * the string to read from. Must be 40 characters long. * @return the converted object id. */ public static ObjectId fromString(String str) { if (str.length() != Constants.OBJECT_ID_STRING_LENGTH) { throw new InvalidObjectIdException(str); } return fromHexString(Constants.encodeASCII(str), 0); }