That class does not implement the Serializable interface, like all IO classes that I know of. Which does make sense.
The bottom line is you can not serialize it. You can mark it as transient so when you serialize the object, the JVM doesn't complain. You will have to handle restoring it after it is deserialized.
"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle
Joined: Jan 30, 2000
Since you can't possibly serialize an OutputStream, I'm guessing that what you would want to do here is get the data that's been written to the OutputStream. Since you've got a ByteArrayOutputStream, you can just close() the stream and then call toByteArray() - which gives you , surprise, a byte array. You should probably do this inside the generatePDF() method, and return the byte from that method. Then you can put the byte into your Vector, and serialize it.