diff options
| author | Bdale Garbee <bdale@gag.com> | 2015-07-15 16:43:50 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2015-07-15 16:43:50 -0600 | 
| commit | 643c2fb03833d658320f476ef731bbb06fe3cc31 (patch) | |
| tree | 878c9df5dbd9bab9169becea4e06e8bae3529541 /altoslib/AltosKML.java | |
| parent | e41786fb384892961a6547e17812a24314ce9623 (diff) | |
| parent | 271f56a41c7e785b0fab7e572325df842d104277 (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'altoslib/AltosKML.java')
| -rw-r--r-- | altoslib/AltosKML.java | 21 | 
1 files changed, 18 insertions, 3 deletions
diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java index aa80fc21..0c9f46c9 100644 --- a/altoslib/AltosKML.java +++ b/altoslib/AltosKML.java @@ -15,14 +15,25 @@   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.   */ -package org.altusmetrum.altoslib_6; +package org.altusmetrum.altoslib_7;  import java.io.*; +import java.util.*; + +class KMLWriter extends PrintWriter { +	public PrintWriter printf(String format, Object ... arguments) { +		return printf(Locale.ROOT, format, arguments); +	} + +	public KMLWriter(File name) throws FileNotFoundException { +		super(name); +	} +}  public class AltosKML implements AltosWriter {  	File			name; -	PrintStream		out; +	PrintWriter		out;  	int			flight_state = -1;  	AltosState		prev = null;  	double			gps_start_altitude; @@ -137,6 +148,10 @@ public class AltosKML implements AltosWriter {  			end();  			prev = null;  		} +		if (out != null) { +			out.close(); +			out = null; +		}  	}  	public void write(AltosState state) { @@ -177,7 +192,7 @@ public class AltosKML implements AltosWriter {  	public AltosKML(File in_name) throws FileNotFoundException {  		name = in_name; -		out = new PrintStream(name); +		out = new KMLWriter(name);  	}  	public AltosKML(String in_string) throws FileNotFoundException {  | 
