Changeset 872 in josm for trunk


Ignore:
Timestamp:
2008-08-26T22:10:43+02:00 (16 years ago)
Author:
ramack
Message:

GpxWriter does not close the stream it writes to after it has finished, to allow writing to a network stream

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java

    r693 r872  
    129129                // TODO: add copyright, etc.
    130130                try {
    131                         new GpxWriter(new FileOutputStream(file)).write(gpxData);
     131                        FileOutputStream fo = new FileOutputStream(file);
     132                        new GpxWriter(fo).write(gpxData);
     133                        fo.flush();
     134                        fo.close();
    132135                } catch (IOException x) {
    133136                        x.printStackTrace();
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r693 r872  
    186186                                        copy(file, tmpFile);
    187187                                }
    188 
    189                                 new GpxWriter(new FileOutputStream(file)).write(layer.data);
     188                                FileOutputStream fo = new FileOutputStream(file);
     189                                new GpxWriter(fo).write(layer.data);
     190                                fo.flush();
     191                                fo.close();
     192
    190193                                if (!Main.pref.getBoolean("save.keepbackup") && (tmpFile != null)) {
    191194                                        tmpFile.delete();
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r627 r872  
    5151                out.print("</gpx>");
    5252                out.flush();
    53                 out.close();
    5453        }
    5554
Note: See TracChangeset for help on using the changeset viewer.