~hjd/ubuntu/wily/xmlgraphics-commons/debian-merged

« back to all changes in this revision

Viewing changes to src/java/org/apache/xmlgraphics/util/io/FlateEncodeOutputStream.java

  • Committer: Bazaar Package Importer
  • Author(s): Vincent Fourmond
  • Date: 2011-02-11 14:15:14 UTC
  • mfrom: (8.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110211141514-h67achft6x31gju1
Tags: 1.4.dfsg-3
Uploading to unstable, hoping we won't break too many things ;-)...

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
6
 * (the "License"); you may not use this file except in compliance with
7
7
 * the License.  You may obtain a copy of the License at
8
 
 * 
 
8
 *
9
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 
 * 
 
10
 *
11
11
 * Unless required by applicable law or agreed to in writing, software
12
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
 * limitations under the License.
16
16
 */
17
17
 
18
 
/* $Id: FlateEncodeOutputStream.java 426584 2006-07-28 16:01:47Z jeremias $ */
 
18
/* $Id: FlateEncodeOutputStream.java 784710 2009-06-15 09:59:48Z vhennebert $ */
19
19
 
20
20
package org.apache.xmlgraphics.util.io;
21
21
 
 
22
import java.io.IOException;
22
23
import java.io.OutputStream;
23
 
import java.io.IOException;
24
24
 
25
25
/**
26
26
 * This class applies a FlateEncode filter to the stream. It is basically the
27
27
 * normal DeflaterOutputStream except now also implementing the Finalizable
28
28
 * interface.
29
29
 *
30
 
 * @version $Id: FlateEncodeOutputStream.java 426584 2006-07-28 16:01:47Z jeremias $
 
30
 * @version $Id: FlateEncodeOutputStream.java 784710 2009-06-15 09:59:48Z vhennebert $
31
31
 */
32
32
public class FlateEncodeOutputStream extends java.util.zip.DeflaterOutputStream
33
33
            implements Finalizable {
34
34
 
35
 
 
36
35
    /** @see java.util.zip.DeflaterOutputStream **/
37
36
    public FlateEncodeOutputStream(OutputStream out) {
38
37
        super(out);
39
38
    }
40
39
 
41
 
 
42
40
    /** @see Finalizable **/
43
41
    public void finalizeStream() throws IOException {
44
42
        finish();
45
43
        flush();
 
44
 
 
45
        // ensure that Deflater resources are released
 
46
        def.end();
 
47
 
46
48
        if (out instanceof Finalizable) {
47
49
            ((Finalizable)out).finalizeStream();
48
50
        }