small fixes
This commit is contained in:
parent
cea1fa60e7
commit
fa353ad87c
2 changed files with 6 additions and 11 deletions
|
@ -565,16 +565,11 @@ public class Algorithms {
|
|||
}
|
||||
}
|
||||
|
||||
public static ByteArrayInputStream createByteArrayIS(InputStream inputStream) throws IOException {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
int i = 0;
|
||||
while ((i = inputStream.read()) != -1) {
|
||||
outputStream.write(i);
|
||||
}
|
||||
inputStream.close();
|
||||
|
||||
byte[] byteArray = outputStream.toByteArray();
|
||||
return new ByteArrayInputStream(byteArray);
|
||||
public static ByteArrayInputStream createByteArrayIS(InputStream in) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
streamCopy(in, out);
|
||||
in.close();
|
||||
return new ByteArrayInputStream(out.toByteArray());
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
|
|
|
@ -95,7 +95,7 @@ public class GpxEngine extends OnlineRoutingEngine {
|
|||
}
|
||||
|
||||
private GPXFile parseGpx(@NonNull String content) {
|
||||
InputStream gpxStream = null;
|
||||
InputStream gpxStream;
|
||||
try {
|
||||
gpxStream = new ByteArrayInputStream(content.getBytes("UTF-8"));
|
||||
return GPXUtilities.loadGPXFile(gpxStream);
|
||||
|
|
Loading…
Reference in a new issue