/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. * * @since 2.1 */ public Match findFormat(byte[] fullInputData, int offset, int len) throws IOException { return _findFormat(new AccessorForReader(fullInputData, offset, len)); }
private Match _findFormat(AccessorForReader acc) throws IOException { ObjectReader bestMatch = null; MatchStrength bestMatchStrength = null; for (ObjectReader f : _readers) { acc.reset(); MatchStrength strength = f.getFactory().hasFormat(acc); // if not better than what we have so far (including minimal level limit), skip if (strength == null || strength.ordinal() < _minimalMatch.ordinal()) { continue; } // also, needs to better match than before if (bestMatch != null) { if (bestMatchStrength.ordinal() >= strength.ordinal()) { continue; } } // finally: if it's good enough match, we are done bestMatch = f; bestMatchStrength = strength; if (strength.ordinal() >= _optimalMatch.ordinal()) { break; } } return acc.createMatcher(bestMatch, bestMatchStrength); }
private Match _findFormat(AccessorForReader acc) throws IOException { ObjectReader bestMatch = null; MatchStrength bestMatchStrength = null; for (ObjectReader f : _readers) { acc.reset(); MatchStrength strength = f.getFactory().hasFormat(acc); // if not better than what we have so far (including minimal level limit), skip if (strength == null || strength.ordinal() < _minimalMatch.ordinal()) { continue; } // also, needs to better match than before if (bestMatch != null) { if (bestMatchStrength.ordinal() >= strength.ordinal()) { continue; } } // finally: if it's good enough match, we are done bestMatch = f; bestMatchStrength = strength; if (strength.ordinal() >= _optimalMatch.ordinal()) { break; } } return acc.createMatcher(bestMatch, bestMatchStrength); }
private Match _findFormat(AccessorForReader acc) throws IOException { ObjectReader bestMatch = null; MatchStrength bestMatchStrength = null; for (ObjectReader f : _readers) { acc.reset(); MatchStrength strength = f.getFactory().hasFormat(acc); // if not better than what we have so far (including minimal level limit), skip if (strength == null || strength.ordinal() < _minimalMatch.ordinal()) { continue; } // also, needs to better match than before if (bestMatch != null) { if (bestMatchStrength.ordinal() >= strength.ordinal()) { continue; } } // finally: if it's good enough match, we are done bestMatch = f; bestMatchStrength = strength; if (strength.ordinal() >= _optimalMatch.ordinal()) { break; } } return acc.createMatcher(bestMatch, bestMatchStrength); }
private Match _findFormat(AccessorForReader acc) throws IOException { ObjectReader bestMatch = null; MatchStrength bestMatchStrength = null; for (ObjectReader f : _readers) { acc.reset(); MatchStrength strength = f.getFactory().hasFormat(acc); // if not better than what we have so far (including minimal level limit), skip if (strength == null || strength.ordinal() < _minimalMatch.ordinal()) { continue; } // also, needs to better match than before if (bestMatch != null) { if (bestMatchStrength.ordinal() >= strength.ordinal()) { continue; } } // finally: if it's good enough match, we are done bestMatch = f; bestMatchStrength = strength; if (strength.ordinal() >= _optimalMatch.ordinal()) { break; } } return acc.createMatcher(bestMatch, bestMatchStrength); }
private Match _findFormat(AccessorForReader acc) throws IOException { ObjectReader bestMatch = null; MatchStrength bestMatchStrength = null; for (ObjectReader f : _readers) { acc.reset(); MatchStrength strength = f.getFactory().hasFormat(acc); // if not better than what we have so far (including minimal level limit), skip if (strength == null || strength.ordinal() < _minimalMatch.ordinal()) { continue; } // also, needs to better match than before if (bestMatch != null) { if (bestMatchStrength.ordinal() >= strength.ordinal()) { continue; } } // finally: if it's good enough match, we are done bestMatch = f; bestMatchStrength = strength; if (strength.ordinal() >= _optimalMatch.ordinal()) { break; } } return acc.createMatcher(bestMatch, bestMatchStrength); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. * * @since 2.1 */ public Match findFormat(byte[] fullInputData, int offset, int len) throws IOException { return _findFormat(new AccessorForReader(fullInputData, offset, len)); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. * * @since 2.1 */ public Match findFormat(byte[] fullInputData, int offset, int len) throws IOException { return _findFormat(new AccessorForReader(fullInputData, offset, len)); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(byte[] fullInputData) throws IOException { return _findFormat(new AccessorForReader(fullInputData)); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(byte[] fullInputData) throws IOException { return _findFormat(new AccessorForReader(fullInputData)); }
/** * Method to call to find format that content (accessible via given * {@link InputStream}) given has, as per configuration of this detector * instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(InputStream in) throws IOException { return _findFormat(new AccessorForReader(in, new byte[_maxInputLookahead])); }
/** * Method to call to find format that content (accessible via given * {@link InputStream}) given has, as per configuration of this detector * instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(InputStream in) throws IOException { return _findFormat(new AccessorForReader(in, new byte[_maxInputLookahead])); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(byte[] fullInputData) throws IOException { return _findFormat(new AccessorForReader(fullInputData)); }
/** * Method to call to find format that content (accessible via given * {@link InputStream}) given has, as per configuration of this detector * instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(InputStream in) throws IOException { return _findFormat(new AccessorForReader(in, new byte[_maxInputLookahead])); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. * * @since 2.1 */ public Match findFormat(byte[] fullInputData, int offset, int len) throws IOException { return _findFormat(new AccessorForReader(fullInputData, offset, len)); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(byte[] fullInputData) throws IOException { return _findFormat(new AccessorForReader(fullInputData)); }
/** * Method to call to find format that content (accessible via given * {@link InputStream}) given has, as per configuration of this detector * instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(InputStream in) throws IOException { return _findFormat(new AccessorForReader(in, new byte[_maxInputLookahead])); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(byte[] fullInputData) throws IOException { return _findFormat(new AccessorForReader(fullInputData)); }
/** * Method to call to find format that given content (full document) * has, as per configuration of this detector instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. * * @since 2.1 */ public Match findFormat(byte[] fullInputData, int offset, int len) throws IOException { return _findFormat(new AccessorForReader(fullInputData, offset, len)); }
/** * Method to call to find format that content (accessible via given * {@link InputStream}) given has, as per configuration of this detector * instance. * * @return Matcher object which contains result; never null, even in cases * where no match (with specified minimal match strength) is found. */ public Match findFormat(InputStream in) throws IOException { return _findFormat(new AccessorForReader(in, new byte[_maxInputLookahead])); }