@Override
    public void visitFromStream(COSStream obj) throws IOException {
        if (willEncrypt) {
            pdDocument.getEncryption().getSecurityHandler()
                    .encryptStream(obj, currentObjectKey.getNumber(),
                            currentObjectKey.getGeneration());
        }

        InputStream input = null;
        try {
            // write the stream content
            visitFromDictionary(obj);
            getStandardOutput().write(STREAM);
            getStandardOutput().writeCRLF();

            input = obj.createRawInputStream();
            IOUtils.copy(input, getStandardOutput());

            getStandardOutput().writeCRLF();
            getStandardOutput().write(ENDSTREAM);
            getStandardOutput().writeEOL();
        } finally {
            if (input != null) {
                input.close();
            }
        }

    }
visitFromObjRef method comment.

@param obj The object that is being visited.
@throws IOException If there is an exception while visiting this object.
tika-fuzzing/src/main/java/org/apache/tika/fuzzing/pdf/EvilCOSWriter.java