Last change
on this file since 6388 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.
|
---|
2 | package org.openstreetmap.josm.io;
|
---|
3 |
|
---|
4 | import java.io.File;
|
---|
5 | import java.io.FileNotFoundException;
|
---|
6 | import java.io.FileOutputStream;
|
---|
7 | import java.io.IOException;
|
---|
8 | import java.io.OutputStream;
|
---|
9 |
|
---|
10 | import org.apache.tools.bzip2.CBZip2OutputStream;
|
---|
11 | import org.openstreetmap.josm.tools.Utils;
|
---|
12 |
|
---|
13 | public 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.