MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / copyLarge

Method copyLarge

src/main/java/com/volmit/adapt/util/IO.java:1268–1277  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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>

Callers 1

copyMethod · 0.95

Calls 2

readMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected