示例#1
0
  public static boolean startsWith(Bytes bytes, Range target, byte[] match, boolean caseSensitive) {

    if (target.length < match.length || target.start < 0 || target.last() >= bytes.limit()) {
      return false;
    }

    boolean result = match(bytes, target.start, match, caseSensitive);

    return result;
  }
示例#2
0
  public static boolean containsAt(
      Bytes bytes, Range target, long offset, byte[] match, boolean caseSensitive) {

    if (offset < 0
        || target.length < offset + match.length
        || target.start < 0
        || target.last() >= bytes.limit()) {
      return false;
    }

    boolean result = match(bytes, target.start + offset, match, caseSensitive);

    return result;
  }