private static int parseHexByte(byte c1, byte c2) { return ((RawParseUtils.parseHexInt4(c1) << 4) | RawParseUtils.parseHexInt4(c2)); }
private boolean isHex() { try { for (int i = pathOffset; i < pathLen; i++) parseHexInt4(path[i]); return true; } catch (ArrayIndexOutOfBoundsException fail) { return false; } } }
private static final int hexUInt32(final byte[] bs, int p, final int end) { if (8 <= end - p) return RawParseUtils.parseHexInt32(bs, p); int r = 0, n = 0; while (n < 8 && p < end) { r <<= 4; r |= RawParseUtils.parseHexInt4(bs[p++]); n++; } return r << (8 - n) * 4; }
/** * Test a string of characters to verify it is a hex format. * <p> * If true the string can be parsed with {@link #fromString(String)}. * * @param id * the string to test. * @return true if the string can converted into an ObjectId. */ public static final boolean isId(String id) { if (id.length() != Constants.OBJECT_ID_STRING_LENGTH) return false; try { for (int i = 0; i < Constants.OBJECT_ID_STRING_LENGTH; i++) { RawParseUtils.parseHexInt4((byte) id.charAt(i)); } return true; } catch (ArrayIndexOutOfBoundsException e) { return false; } }
private int parseFanoutCell() { if (getNameLength() == 2 && isTree()) { try { return (parseHexInt4(path[pathOffset + 0]) << 4) | parseHexInt4(path[pathOffset + 1]); } catch (ArrayIndexOutOfBoundsException notHex) { return -1; } } else { return -1; } }
/** * Test a string of characters to verify it is a hex format. * <p> * If true the string can be parsed with {@link #fromString(String)}. * * @param id * the string to test. * @return true if the string can converted into an AbbreviatedObjectId. */ public static final boolean isId(String id) { if (id.length() < 2 || Constants.OBJECT_ID_STRING_LENGTH < id.length()) return false; try { for (int i = 0; i < id.length(); i++) RawParseUtils.parseHexInt4((byte) id.charAt(i)); return true; } catch (ArrayIndexOutOfBoundsException e) { return false; } }
private boolean isHex() { try { for (int i = pathOffset; i < pathLen; i++) parseHexInt4(path[i]); return true; } catch (ArrayIndexOutOfBoundsException fail) { return false; } } }
private boolean isHex() { try { for (int i = pathOffset; i < pathLen; i++) parseHexInt4(path[i]); return true; } catch (ArrayIndexOutOfBoundsException fail) { return false; } } }
private static int parseHexByte(byte c1, byte c2) { return ((RawParseUtils.parseHexInt4(c1) << 4) | RawParseUtils.parseHexInt4(c2)); }
private static int parseHexByte(byte c1, byte c2) { return ((RawParseUtils.parseHexInt4(c1) << 4) | RawParseUtils.parseHexInt4(c2)); }
/** * Test a string of characters to verify that it can be interpreted as * LongObjectId. * <p> * If true the string can be parsed with {@link #fromString(String)}. * * @param id * the string to test. * @return true if the string can converted into an LongObjectId. */ public static final boolean isId(final String id) { if (id.length() != Constants.LONG_OBJECT_ID_STRING_LENGTH) return false; try { for (int i = 0; i < Constants.LONG_OBJECT_ID_STRING_LENGTH; i++) { RawParseUtils.parseHexInt4((byte) id.charAt(i)); } return true; } catch (ArrayIndexOutOfBoundsException e) { return false; } }
/** * Test a string of characters to verify it is a hex format. * <p> * If true the string can be parsed with {@link #fromString(String)}. * * @param id * the string to test. * @return true if the string can converted into an ObjectId. */ public static final boolean isId(final String id) { if (id.length() != Constants.OBJECT_ID_STRING_LENGTH) return false; try { for (int i = 0; i < Constants.OBJECT_ID_STRING_LENGTH; i++) { RawParseUtils.parseHexInt4((byte) id.charAt(i)); } return true; } catch (ArrayIndexOutOfBoundsException e) { return false; } }
private static final long hexUInt64(final byte[] bs, int p, final int end) { if (16 <= end - p) return RawParseUtils.parseHexInt64(bs, p); long r = 0; int n = 0; while (n < 16 && p < end) { r <<= 4; r |= RawParseUtils.parseHexInt4(bs[p++]); n++; } return r << (16 - n) * 4; }
private int parseFanoutCell() { if (getNameLength() == 2 && isTree()) { try { return (parseHexInt4(path[pathOffset + 0]) << 4) | parseHexInt4(path[pathOffset + 1]); } catch (ArrayIndexOutOfBoundsException notHex) { return -1; } } else { return -1; } }
private static final int hexUInt32(final byte[] bs, int p, final int end) { if (8 <= end - p) return RawParseUtils.parseHexInt32(bs, p); int r = 0, n = 0; while (n < 8 && p < end) { r <<= 4; r |= RawParseUtils.parseHexInt4(bs[p++]); n++; } return r << (8 - n) * 4; }
private static final long hexUInt64(final byte[] bs, int p, final int end) { if (16 <= end - p) return RawParseUtils.parseHexInt64(bs, p); long r = 0; int n = 0; while (n < 16 && p < end) { r <<= 4; r |= RawParseUtils.parseHexInt4(bs[p++]); n++; } return r << (16 - n) * 4; }
private int parseFanoutCell() { if (getNameLength() == 2 && isTree()) { try { return (parseHexInt4(path[pathOffset + 0]) << 4) | parseHexInt4(path[pathOffset + 1]); } catch (ArrayIndexOutOfBoundsException notHex) { return -1; } } else { return -1; } }
private static final int hexUInt32(final byte[] bs, int p, final int end) { if (8 <= end - p) return RawParseUtils.parseHexInt32(bs, p); int r = 0, n = 0; while (n < 8 && p < end) { r <<= 4; r |= RawParseUtils.parseHexInt4(bs[p++]); n++; } return r << (8 - n) * 4; }
/** * Test a string of characters to verify it is a hex format. * <p> * If true the string can be parsed with {@link #fromString(String)}. * * @param id * the string to test. * @return true if the string can converted into an AbbreviatedObjectId. */ public static final boolean isId(String id) { if (id.length() < 2 || Constants.OBJECT_ID_STRING_LENGTH < id.length()) return false; try { for (int i = 0; i < id.length(); i++) RawParseUtils.parseHexInt4((byte) id.charAt(i)); return true; } catch (ArrayIndexOutOfBoundsException e) { return false; } }
/** * Test a string of characters to verify it is a hex format. * <p> * If true the string can be parsed with {@link #fromString(String)}. * * @param id * the string to test. * @return true if the string can converted into an AbbreviatedObjectId. */ public static final boolean isId(final String id) { if (id.length() < 2 || Constants.OBJECT_ID_STRING_LENGTH < id.length()) return false; try { for (int i = 0; i < id.length(); i++) RawParseUtils.parseHexInt4((byte) id.charAt(i)); return true; } catch (ArrayIndexOutOfBoundsException e) { return false; } }