final InputStream bin = (in instanceof BufferedInputStream) ? in
: new BufferedInputStream(in);
// Does not have the desired effect.
DateFieldHandler.setDefaultTimeZone(UTC);
try {
GpxReader reader = new GpxReader();
reader.parse(new InputSource(bin));
gpx = reader.getGpx();
} catch (Exception ex) {
IOException ioex = new IOException(
"Error parsing GPX. Make sure that the input is in GPX 1.1 format.");
ioex.initCause(ex);
throw ioex;