/** * Matches the fragment against the position in the ByteReader given. * * @param bytes The byte reader to match the bytes with. * @param matchFrom The position to match from. * @return Whether the fragment matches at the position given. */ public final boolean matchesBytes(final ByteReader bytes, final long matchFrom) { return matcher.matches(bytes, matchFrom); }
/** * Returns a regular expression representation of this fragment. * * @param prettyPrint whether to pretty print the regular expression. * @return a regular expression defining this fragment, but minus any offsets defined here * (handled by the parent subsequence). */ public final String toRegularExpression(final boolean prettyPrint) { return matcher == null ? "" : matcher.toRegularExpression(prettyPrint); }
/** @return The number of bytes matched by this fragment. */ public final int getNumBytes() { return matcher == null ? 0 : matcher.length(); }