Package org.jacoco.core.internal
Class ContentTypeDetector
java.lang.Object
org.jacoco.core.internal.ContentTypeDetector
Detector for content types of binary streams based on a magic headers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFile type Java classstatic final intFile type GZIP compressed Datastatic final intFile type Pack200 archivestatic final intUnknown file typestatic final intFile type ZIP archive -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new detector based on the given input. -
Method Summary
Modifier and TypeMethodDescriptionReturns an input stream instance to read the complete content (including the header) of the underlying stream.intgetType()Returns the detected file type.
-
Field Details
-
UNKNOWN
public static final int UNKNOWNUnknown file type- See Also:
-
CLASSFILE
public static final int CLASSFILEFile type Java class- See Also:
-
ZIPFILE
public static final int ZIPFILEFile type ZIP archive- See Also:
-
GZFILE
public static final int GZFILEFile type GZIP compressed Data- See Also:
-
PACK200FILE
public static final int PACK200FILEFile type Pack200 archive- See Also:
-
-
Constructor Details
-
ContentTypeDetector
Creates a new detector based on the given input. To process the complete original input afterwards use the stream returned bygetInputStream().- Parameters:
in- input to read the header from- Throws:
IOException- if the stream can't be read
-
-
Method Details
-
getInputStream
Returns an input stream instance to read the complete content (including the header) of the underlying stream.- Returns:
- input stream containing the complete content
-
getType
public int getType()Returns the detected file type.- Returns:
- file type
-