source: josm/trunk/src/org/openstreetmap/josm/io/OsmBzip2Exporter.java@ 6340

Last change on this file since 6340 was 6289, checked in by Don-vip, 11 years ago

Sonar/Findbugs - fix various problems

  • Property svn:eol-style set to native
File size: 919 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import java.io.File;
5import java.io.FileNotFoundException;
6import java.io.FileOutputStream;
7import java.io.IOException;
8import java.io.OutputStream;
9
10import org.apache.tools.bzip2.CBZip2OutputStream;
11import org.openstreetmap.josm.tools.Utils;
12
13public class OsmBzip2Exporter extends OsmExporter {
14
15 /**
16 * Constructs a new {@code OsmBzip2Exporter}.
17 */
18 public OsmBzip2Exporter() {
19 super(OsmBzip2Importer.FILE_FILTER);
20 }
21
22 @Override
23 protected OutputStream getOutputStream(File file) throws FileNotFoundException, IOException {
24 OutputStream out = new FileOutputStream(file);
25 try {
26 out.write('B');
27 out.write('Z');
28 return new CBZip2OutputStream(out);
29 } catch (IOException e) {
30 Utils.close(out);
31 throw e;
32 }
33 }
34}
Note: See TracBrowser for help on using the repository browser.