Changeset 9280 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-01-03T16:30:55+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r9274 r9280 23 23 import java.io.InputStream; 24 24 import java.io.InputStreamReader; 25 import java.io.OutputStream;26 25 import java.io.UnsupportedEncodingException; 27 26 import java.net.HttpURLConnection; … … 435 434 436 435 /** 437 * Copy data from source stream to output stream.438 * @param source source stream439 * @param destination target stream440 * @return number of bytes copied441 * @throws IOException if any I/O error occurs442 */443 public static int copyStream(InputStream source, OutputStream destination) throws IOException {444 int count = 0;445 byte[] b = new byte[512];446 int read;447 while ((read = source.read(b)) != -1) {448 count += read;449 destination.write(b, 0, read);450 }451 return count;452 }453 454 /**455 436 * Deletes a directory recursively. 456 437 * @param path The directory to delete
Note: See TracChangeset
for help on using the changeset viewer.