Package org.apache.tika.extractor
Class DefaultEmbeddedStreamTranslator
- java.lang.Object
- 
- org.apache.tika.extractor.DefaultEmbeddedStreamTranslator
 
- 
- All Implemented Interfaces:
- EmbeddedStreamTranslator
 
 public class DefaultEmbeddedStreamTranslator extends Object implements EmbeddedStreamTranslator Loads EmbeddedStreamTranslators via service loading. Tries to run each in turn and returns the first non-null value. If no translation has occurred, this returns the original InputStream. If a translation has occurred, the translator will consume the InputStream but not close it.
- 
- 
Constructor SummaryConstructors Constructor Description DefaultEmbeddedStreamTranslator()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanshouldTranslate(InputStream inputStream, Metadata metadata)This should sniff the stream to determine if it needs to be translated.InputStreamtranslate(InputStream inputStream, Metadata metadata)This will consume the InputStream and return a new stream of translated bytes.
 
- 
- 
- 
Method Detail- 
shouldTranslatepublic boolean shouldTranslate(InputStream inputStream, Metadata metadata) throws IOException This should sniff the stream to determine if it needs to be translated. The translator is responsible for resetting the stream if any bytes have been read.- Specified by:
- shouldTranslatein interface- EmbeddedStreamTranslator
- Parameters:
- inputStream-
- metadata-
- Returns:
- Throws:
- IOException
 
 - 
translatepublic InputStream translate(InputStream inputStream, Metadata metadata) throws IOException This will consume the InputStream and return a new stream of translated bytes.- Specified by:
- translatein interface- EmbeddedStreamTranslator
- Parameters:
- inputStream-
- metadata-
- Returns:
- Throws:
- IOException
 
 
- 
 
-