public HashMap<String,PDFObject> getDictionary() throws IOException {
        if (type == INDIRECT) {
            return dereference().getDictionary();
        } else if (type == DICTIONARY || type == STREAM) {
            return (HashMap<String,PDFObject>) value;
        }

        // wrong type
        return new HashMap<String,PDFObject>();
    }