public static boolean isNumericInfinite(PositionedByteRange src) {
    byte x = (-1 == Integer.signum(src.peek()) ? DESCENDING : ASCENDING).apply(src.peek());
    return NEG_INF == x || POS_INF == x;
  }
Return true when the next encoded value in {@code src} uses Numeric encoding and is
{@code Infinite}, false otherwise.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java