Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6896987eb3
2 changed files with 18 additions and 4 deletions
|
@ -364,7 +364,7 @@ public class OsmandRegions {
|
||||||
quadTree = new QuadTree<String>(new QuadRect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE),
|
quadTree = new QuadTree<String>(new QuadRect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE),
|
||||||
8, 0.55f);
|
8, 0.55f);
|
||||||
final ResultMatcher<BinaryMapDataObject> resultMatcher = new ResultMatcher<BinaryMapDataObject>() {
|
final ResultMatcher<BinaryMapDataObject> resultMatcher = new ResultMatcher<BinaryMapDataObject>() {
|
||||||
int c = 0;
|
// int c = 0;
|
||||||
@Override
|
@Override
|
||||||
public boolean publish(BinaryMapDataObject object) {
|
public boolean publish(BinaryMapDataObject object) {
|
||||||
if (object.getPointsLength() < 1) {
|
if (object.getPointsLength() < 1) {
|
||||||
|
@ -372,9 +372,9 @@ public class OsmandRegions {
|
||||||
}
|
}
|
||||||
initTypes(object);
|
initTypes(object);
|
||||||
String nm = object.getNameByType(downloadNameType);
|
String nm = object.getNameByType(downloadNameType);
|
||||||
if(nm != null) {
|
// if(nm != null) {
|
||||||
System.out.println((c++) +" " + nm);
|
// System.out.println((c++) +" " + nm);
|
||||||
}
|
// }
|
||||||
if (!countriesByDownloadName.containsKey(nm)) {
|
if (!countriesByDownloadName.containsKey(nm)) {
|
||||||
LinkedList<BinaryMapDataObject> ls = new LinkedList<BinaryMapDataObject>();
|
LinkedList<BinaryMapDataObject> ls = new LinkedList<BinaryMapDataObject>();
|
||||||
countriesByDownloadName.put(nm, ls);
|
countriesByDownloadName.put(nm, ls);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.io.Closeable;
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -212,6 +213,19 @@ public class Algorithms {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void fileCopy(File src, File dst) throws IOException {
|
||||||
|
FileOutputStream fout = new FileOutputStream(dst);
|
||||||
|
try {
|
||||||
|
FileInputStream fin = new FileInputStream(src);
|
||||||
|
try {
|
||||||
|
Algorithms.streamCopy(fin, fout);
|
||||||
|
} finally {
|
||||||
|
fin.close();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
fout.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static void streamCopy(InputStream in, OutputStream out) throws IOException{
|
public static void streamCopy(InputStream in, OutputStream out) throws IOException{
|
||||||
byte[] b = new byte[BUFFER_SIZE];
|
byte[] b = new byte[BUFFER_SIZE];
|
||||||
int read;
|
int read;
|
||||||
|
|
Loading…
Reference in a new issue