@Override
    public void endElement(String uri, String localName, String name) throws SAXException {
        super.endElement(uri, localName, name);

        if (!packageEntryDepths.isEmpty() && packageEntryDepths.getLast() == currentDepth) {
            packageEntryDepths.removeLast();
        }

        currentDepth--;
    }
Records the given number of output characters (or more accurately
UTF-16 code units). Throws an exception if the recorded number of
characters highly exceeds the number of input bytes read.

@param length number of new output characters produced
@throws SAXException if a zip bomb is detected
tika-core/src/main/java/org/apache/tika/sax/SecureContentHandler.java