File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed
io/src/main/java/com/itextpdf/io/source
kernel/src/main/java/com/itextpdf/kernel/pdf Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ This file is part of the iText (R) project.
4646
4747import com .itextpdf .io .IOException ;
4848
49- public class OutputStream <T extends java .io .OutputStream > extends java .io .OutputStream {
49+ import java .io .Serializable ;
50+
51+ public class OutputStream <T extends java .io .OutputStream > extends java .io .OutputStream implements Serializable {
52+
53+ private static final long serialVersionUID = -5337390096148526418L ;
5054
5155 //long=19 + max frac=6 => 26 => round to 32.
5256 private final ByteBuffer numBuffer = new ByteBuffer (32 );
@@ -233,4 +237,22 @@ public void reset() {
233237 } else
234238 throw new IOException (IOException .BytesCanBeResetInByteArrayOutputStreamOnly );
235239 }
240+
241+ /**
242+ * This method is invoked while deserialization
243+ */
244+ private void readObject (java .io .ObjectInputStream in ) throws java .io .IOException , ClassNotFoundException {
245+ in .defaultReadObject ();
246+ }
247+
248+ /**
249+ * This method is invoked while serialization
250+ */
251+ private void writeObject (java .io .ObjectOutputStream out ) throws java .io .IOException {
252+ java .io .OutputStream tempOutputStream = outputStream ;
253+ outputStream = null ;
254+ out .defaultWriteObject ();
255+ outputStream = tempOutputStream ;
256+ }
257+
236258}
Original file line number Diff line number Diff line change @@ -52,15 +52,15 @@ This file is part of the iText (R) project.
5252import com .itextpdf .kernel .PdfException ;
5353import com .itextpdf .kernel .crypto .OutputStreamEncryption ;
5454import com .itextpdf .kernel .pdf .filters .FlateDecodeFilter ;
55- import org .slf4j .Logger ;
56- import org .slf4j .LoggerFactory ;
5755
5856import java .io .IOException ;
59- import java .io .Serializable ;
6057import java .text .MessageFormat ;
6158import java .util .Map ;
6259
63- public class PdfOutputStream extends OutputStream <PdfOutputStream > implements Serializable {
60+ import org .slf4j .Logger ;
61+ import org .slf4j .LoggerFactory ;
62+
63+ public class PdfOutputStream extends OutputStream <PdfOutputStream > {
6464
6565 private static final long serialVersionUID = -548180479472231600L ;
6666
You can’t perform that action at this time.
0 commit comments