
de.westnordost.osmapi.traces.GpxInputStreamWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of osmapi-traces Show documentation
Show all versions of osmapi-traces Show documentation
Uploads all artifacts belonging to configuration ':libs:traces:archives'
The newest version!
package de.westnordost.osmapi.traces;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import de.westnordost.osmapi.ApiRequestWriter;
public class GpxInputStreamWriter implements ApiRequestWriter
{
private InputStream gpx;
public GpxInputStreamWriter(InputStream in)
{
this.gpx = in;
}
@Override
public String getContentType()
{
return "application/gpx+xml";
}
public void write(OutputStream out) throws IOException
{
byte[] buffer = new byte[8192];
int length;
while ((length = gpx.read(buffer)) != -1) out.write(buffer, 0, length);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy