ch.randelshofer.activation
Class JAIRecognizer
java.lang.Object
ch.randelshofer.activation.JAIRecognizer
- All Implemented Interfaces:
- Recognizer
public class JAIRecognizer
- extends java.lang.Object
- implements Recognizer
This content type detector uses the JAI (Java Advanced Imaging API)
to detect file types.
- Version:
- 1.2 2006-07-20 Reworked for Java 1.5.
1.1 2002-02-12 Return application/octet-stream' for unknown file types.
1.0.1 1999-13-12 Macintosh Runtime for Java crashes when
the Java advanced Imaging API is not available.
history 1.0 1998-10-19
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Immensee, Switzerland.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAIRecognizer
protected JAIRecognizer()
getInstance
public static JAIRecognizer getInstance()
getMinimalDeterminableDataLength
public int getMinimalDeterminableDataLength()
- Return the number of bytes needed to
determine the content type.
- Specified by:
getMinimalDeterminableDataLength in interface Recognizer
getContentType
public java.lang.String getContentType(byte[] dataSnippet)
- Return the base MIME Type of this data. This method is
expected to ALWAYS return a valid (non-null) MIME Type.
- Specified by:
getContentType in interface Recognizer
- Parameters:
dataSnippet - the first few bytes of the data file.
- Returns:
- MIME Type or application/octet-stream' if content type
can not be determined.
getCodec
public com.sun.media.jai.codec.ImageCodec getCodec(byte[] dataSnippet)