Code example for DefaultHandler

0
    private SecureContentHandler handler;
 
    @Before 
    public void setUp() { 
        stream = TikaInputStream.get(new NullInputStream(MANY_BYTES));
        handler = new SecureContentHandler(new DefaultHandler(), stream);
    } 
 
    @Test
    public void testZeroCharactersPerByte() throws IOException {
        try { 
            char[] ch = new char[] { 'x' };
            for (int i = 0; i < MANY_BYTES; i++) {
                stream.read();
            } 
            handler.characters(ch, 0, 1);
        } catch (SAXException e) {
            fail("Unexpected SAXException"); 
        } 
    } 
Connect your IDE to all the code out there  Get Codota for Java