Copy bytes from a large (over 2GB) InputStream to an OutputStream . This method buffers the input internally, so there is no need to use a BufferedInputStream . @param input the InputStream to read from @param output the OutputStream</cod
(InputStream input, OutputStream output)
| 1266 | * @since Commons IO 1.3 |
| 1267 | */ |
| 1268 | public static long copyLarge(InputStream input, OutputStream output) throws IOException { |
| 1269 | byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; |
| 1270 | long count = 0; |
| 1271 | int n = 0; |
| 1272 | while (-1 != (n = input.read(buffer))) { |
| 1273 | output.write(buffer, 0, n); |
| 1274 | count += n; |
| 1275 | } |
| 1276 | return count; |
| 1277 | } |
| 1278 | |
| 1279 | /** |
| 1280 | * Copy bytes from an <code>InputStream</code> to chars on a <code>Writer</code> |