org.jacoco.core.internal.analysis
Class ContentTypeDetector

java.lang.Object
  extended by org.jacoco.core.internal.analysis.ContentTypeDetector

public class ContentTypeDetector
extends Object

Detector for content types of binary streams based on a magic headers.


Field Summary
static int CLASSFILE
          File type Java class
static int UNKNOWN
          Unknown file type
static int ZIPFILE
          File type ZIP archive
 
Constructor Summary
ContentTypeDetector(InputStream in)
          Creates a new detector based on the given input.
 
Method Summary
 InputStream getInputStream()
          Returns an input stream instance to read the complete content (including the header) of the underlying stream.
 int getType()
          Returns the detected file type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
Unknown file type

See Also:
Constant Field Values

CLASSFILE

public static final int CLASSFILE
File type Java class

See Also:
Constant Field Values

ZIPFILE

public static final int ZIPFILE
File type ZIP archive

See Also:
Constant Field Values
Constructor Detail

ContentTypeDetector

public ContentTypeDetector(InputStream in)
                    throws IOException
Creates a new detector based on the given input. To process the complete original input afterwards use the stream returned by getInputStream().

Parameters:
in - input to read the header from
Throws:
IOException
Method Detail

getInputStream

public InputStream 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


Copyright © 2009-2011 Mountainminds GmbH & Co. KG. All Rights Reserved.