use of org.apache.tika.extractor.ContainerExtractor in project tika by apache.
the class RTFParserTest method testBinControlWord.
// TIKA-782
@Test
public void testBinControlWord() throws Exception {
ByteCopyingHandler embHandler = new ByteCopyingHandler();
try (TikaInputStream tis = TikaInputStream.get(getResourceAsStream("/test-documents/testBinControlWord.rtf"))) {
ContainerExtractor ex = new ParserContainerExtractor();
assertEquals(true, ex.isSupported(tis));
ex.extract(tis, ex, embHandler);
}
assertEquals(1, embHandler.bytes.size());
byte[] bytes = embHandler.bytes.get(0);
assertEquals(10, bytes.length);
//}
assertEquals(125, (int) bytes[4]);
//make sure that at least the last value is correct
assertEquals(-1, (int) bytes[9]);
}
Aggregations