- Timestamp:
- 2016-01-16T18:31:07+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java
r9458 r9491 5 5 6 6 import java.io.ByteArrayInputStream; 7 import java.io.ByteArrayOutputStream; 7 8 import java.io.File; 8 9 import java.io.FileInputStream; … … 18 19 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; 19 20 import org.openstreetmap.josm.data.osm.DataSet; 20 21 import sun.misc.IOUtils;22 21 23 22 /** … … 81 80 File file = new File(DATA_FILE); 82 81 try (InputStream is = decompressBeforeRead ? Compression.getUncompressedFileInputStream(file) : new FileInputStream(file)) { 83 return new ByteArrayInputStream(IOUtils.readFully(is, -1, false)); 82 ByteArrayOutputStream temporary = new ByteArrayOutputStream(); 83 byte[] readBuffer = new byte[4096]; 84 int readBytes = 0; 85 while (readBytes != -1) { 86 temporary.write(readBuffer, 0, readBytes); 87 readBytes = is.read(readBuffer); 88 } 89 return new ByteArrayInputStream(temporary.toByteArray()); 84 90 } 85 91 }
Note:
See TracChangeset
for help on using the changeset viewer.