[Solved] Return as ByteArrayOutputStream instead of FileOutputStream

I am slightly confused to what you are asking. I have not used Apache Fop, but will try answer this question. If you want to read PDF file as byte array use input streams instead. But if you want to use ByteArrayOutputStream that is writing bytes you basically answered your own question, try using existing … Read more

[Solved] Incompatible types; found: class java.lang.String, required: class java.io.ByteArrayOutputStream

You’re trying to assign the result of replaceAll (a String) to stream, a ByteArrayOutputStream. I think you mean to just create a new variable of type String: ByteArrayOutputStream stream= new ByteArrayOutputStream(); String str = stream.toString().replaceAll(“&lt;”,”<“); You can then convert the String to a byte array, using getBytes: byte[] bytes = str.getBytes(); 7 solved Incompatible types; … Read more