@SuppressWarnings("nls")
    public Object readObject() {
        if (inputStream == null) {
            return null;
        }
        if (saxHandler == null) {
            saxHandler = new SAXHandler();
            try {
                SAXParserFactory.newInstance().newSAXParser().parse(
                        inputStream, saxHandler);
            } catch (Exception e) {
                this.listener.exceptionThrown(e);
            }
        }

        if (readObjIndex >= readObjs.size()) {
            throw new ArrayIndexOutOfBoundsException(Messages.getString("custom.beans.70"));
        }
        Elem elem = readObjs.get(readObjIndex);
        if (!elem.isClosed) {
            // bad element, error occurred while parsing
            throw new ArrayIndexOutOfBoundsException(Messages.getString("custom.beans.70"));
        }
        readObjIndex++;
        return elem.result;
    }