public class DataFormatDetector
extends java.lang.Object
JsonFactory
instances to use for actual low-level
detection.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_INPUT_LOOKAHEAD
By default we will look ahead at most 64 bytes; in most cases,
much less (4 bytes or so) is needed, but we will allow bit more
leniency to support data formats that need more complex heuristics.
|
Constructor and Description |
---|
DataFormatDetector(java.util.Collection<JsonFactory> detectors) |
DataFormatDetector(JsonFactory... detectors) |
Modifier and Type | Method and Description |
---|---|
DataFormatMatcher |
findFormat(byte[] fullInputData)
Method to call to find format that given content (full document)
has, as per configuration of this detector instance.
|
DataFormatMatcher |
findFormat(byte[] fullInputData,
int offset,
int len)
Method to call to find format that given content (full document)
has, as per configuration of this detector instance.
|
DataFormatMatcher |
findFormat(java.io.InputStream in)
Method to call to find format that content (accessible via given
InputStream ) given has, as per configuration of this detector
instance. |
java.lang.String |
toString() |
DataFormatDetector |
withMaxInputLookahead(int lookaheadBytes)
Method that will return a detector instance that allows detectors to
read up to specified number of bytes when determining format match strength.
|
DataFormatDetector |
withMinimalMatch(MatchStrength minMatch)
Method that will return a detector instance that uses given
minimal match level; match that may be returned unless a stronger match
is found with other format detectors.
|
DataFormatDetector |
withOptimalMatch(MatchStrength optMatch)
Method that will return a detector instance that uses given
optimal match level (match that is considered sufficient to return, without
trying to find stronger matches with other formats).
|
public static final int DEFAULT_MAX_INPUT_LOOKAHEAD
public DataFormatDetector(JsonFactory... detectors)
public DataFormatDetector(java.util.Collection<JsonFactory> detectors)
public DataFormatDetector withOptimalMatch(MatchStrength optMatch)
public DataFormatDetector withMinimalMatch(MatchStrength minMatch)
public DataFormatDetector withMaxInputLookahead(int lookaheadBytes)
public DataFormatMatcher findFormat(java.io.InputStream in) throws java.io.IOException
InputStream
) given has, as per configuration of this detector
instance.java.io.IOException
public DataFormatMatcher findFormat(byte[] fullInputData) throws java.io.IOException
java.io.IOException
public DataFormatMatcher findFormat(byte[] fullInputData, int offset, int len) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"