@@ -64,9 +64,6 @@ public class PdfWriter extends PdfOutputStream {
64
64
private static final byte [] obj = ByteUtils .getIsoBytes (" obj\n " );
65
65
private static final byte [] endobj = ByteUtils .getIsoBytes ("\n endobj\n " );
66
66
67
- // For internal usage only
68
- private PdfOutputStream duplicateStream = null ;
69
-
70
67
protected WriterProperties properties ;
71
68
72
69
/**
@@ -114,9 +111,6 @@ public PdfWriter(java.io.OutputStream os) {
114
111
public PdfWriter (java .io .OutputStream os , WriterProperties properties ) {
115
112
super (new CountOutputStream (FileUtil .wrapWithBufferedOutputStream (os )));
116
113
this .properties = properties ;
117
- if (properties .debugMode ) {
118
- duplicateStream = new PdfOutputStream (new ByteArrayOutputStream ());
119
- }
120
114
}
121
115
122
116
/**
@@ -192,80 +186,6 @@ public PdfWriter setSmartMode(boolean smartMode) {
192
186
return this ;
193
187
}
194
188
195
- /**
196
- * Write an integer to the underlying stream
197
- *
198
- * @param b integer to write
199
- * @throws java.io.IOException if an I/O error occurs. In particular,
200
- * an <code>IOException</code> may be thrown if the output stream
201
- * has been closed.
202
- */
203
- @ Override
204
- public void write (int b ) throws java .io .IOException {
205
- super .write (b );
206
- if (duplicateStream != null ) {
207
- duplicateStream .write (b );
208
- }
209
- }
210
-
211
- /**
212
- * Write a byte array to the underlying stream
213
- *
214
- * @param b byte array to write
215
- * @throws java.io.IOException if an I/O error occurs. In particular,
216
- * an <code>IOException</code> may be thrown if the output stream
217
- * has been closed.
218
- */
219
- @ Override
220
- public void write (byte [] b ) throws java .io .IOException {
221
- super .write (b );
222
- if (duplicateStream != null ) {
223
- duplicateStream .write (b );
224
- }
225
- }
226
-
227
- /**
228
- * Write a slice of the passed byte array to the underlying stream
229
- *
230
- * @param b byte array to slice and write.
231
- * @param off starting index of the slice.
232
- * @param len length of the slice.
233
- * @throws java.io.IOException if an I/O error occurs. In particular,
234
- * an <code>IOException</code> may be thrown if the output stream
235
- * has been closed.
236
- */
237
- @ Override
238
- public void write (byte [] b , int off , int len ) throws java .io .IOException {
239
- super .write (b , off , len );
240
- if (duplicateStream != null ) {
241
- duplicateStream .write (b , off , len );
242
- }
243
- }
244
-
245
-
246
- /**
247
- * Close the writer and underlying streams.
248
- *
249
- * @throws java.io.IOException if an I/O error occurs. In particular,
250
- * an <code>IOException</code> may be thrown if the output stream
251
- * has been closed previously.
252
- */
253
- @ Override
254
- public void close () throws IOException {
255
- try {
256
- super .close ();
257
- } finally {
258
- try {
259
- if (duplicateStream != null ) {
260
- duplicateStream .close ();
261
- }
262
- } catch (Exception ex ) {
263
- Logger logger = LoggerFactory .getLogger (PdfWriter .class );
264
- logger .error ("Closing of the duplicatedStream failed." , ex );
265
- }
266
- }
267
- }
268
-
269
189
/**
270
190
* Gets the current object stream.
271
191
*
0 commit comments