Author: jukka
Date: Tue Jan 27 21:52:16 2009
New Revision: 738260
URL: http://svn.apache.org/viewvc?rev=738260&view=rev
Log:
TIKA-95: Pluggable magic header detectors
Changed the Detector contract to so that the document input stream must support
the mark feature and that the detector must use mark/reset to restore the
stream to the original state before returning.
Modified:
lucene/tika/trunk/src/main/java/org/apache/tika/detect/Detector.java
Modified: lucene/tika/trunk/src/main/java/org/apache/tika/detect/Detector.java
URL:
http://svn.apache.org/viewvc/lucene/tika/trunk/src/main/java/org/apache/tika/detect/Detector.java?rev=738260&r1=738259&r2=738260&view=diff
==============================================================================
--- lucene/tika/trunk/src/main/java/org/apache/tika/detect/Detector.java
(original)
+++ lucene/tika/trunk/src/main/java/org/apache/tika/detect/Detector.java Tue
Jan 27 21:52:16 2009
@@ -39,13 +39,12 @@
* If the document input stream is not available, then the first
* argument may be <code>null</code>. Otherwise the detector may
* read bytes from the start of the stream to help in type detection.
- * The stream must not be closed or otherwise manipulated other by
- * simply reading bytes from it, as the caller may use the mark feature
- * to be able to reset the stream to the beginning for proper parsing
- * when the content type is detected. For the same reason the detector
- * must only read up to a limited number of bytes from the stream to
- * avoid potentially unbounded memory use for the buffer of a marked
- * a stream.
+ * The given stream is guaranteed to support the
+ * {...@link InputStream#markSupported() mark feature} and the detector
+ * is expected to {...@link InputStream#mark(int) mark} the stream before
+ * reading any bytes from it, and to {...@link InputStream#reset() reset}
+ * the stream before returning. The stream must not be closed by the
+ * detector.
* <p>
* The given input metadata is only read, not modified, by the detector.
*