Java Utililty Methods InputStream Copy

List of utility methods to do InputStream Copy

Description

The list of methods to do InputStream Copy are organized into topic(s).

Method

longcopyLarge(InputStream in, OutputStream out, byte[] buffer)
Copies bytes from a large (over 2GB) InputStream to an OutputStream via a byte buffer.
long count = 0;
int n = 0;
while ((n = in.read(buffer)) != -1) {
    out.write(buffer, 0, n);
    count += n;
return count;
longcopyLarge(InputStream input, File outputFile)
copy Large
byte[] buffer = new byte[16384];
long count = 0;
int n = 0;
outputFile.getParentFile().mkdirs();
FileOutputStream output = new FileOutputStream(outputFile);
try {
    while (-1 != (n = input.read(buffer))) {
        output.write(buffer, 0, n);
...
longcopyLarge(InputStream input, OutputStream output)
copy Large
return copyLarge(input, output, new byte[DEFAULT_BUFFER_SIZE]);
longcopyLarge(InputStream input, OutputStream output)
copy Large
byte[] buffer = new byte[4096];
long count = 0L;
int n = 0;
while (-1 != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
return count;
...
longcopyLarge(InputStream input, OutputStream output)
copy Large
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
long count = 0;
int n = 0;
while (-1 != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
return count;
...
longcopyLarge(InputStream input, OutputStream output)
Copy bytes from a large (over 2GB) InputStream to an OutputStream.
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
long count = 0;
int n = 0;
while (-1 != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
return count;
...
longcopyLarge(InputStream input, OutputStream output)
Copy bytes from an InputStream to an OutputStream.
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
long count = 0;
int n = 0;
while (-1 != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
return count;
...
longcopyLarge(InputStream input, OutputStream output)
Copy bytes from a large (over 2GB) InputStream to an OutputStream.
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
long count = 0;
int n;
while (-1 != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
return count;
...
longcopyLarge(InputStream input, OutputStream output)
copy the input stream to out.
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
long count = 0;
int n = 0;
while (EOF != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
return count;
...
longcopyLarge(InputStream input, OutputStream output)
Copy bytes from a large (over 2GB) InputStream to an OutputStream.
return copyLarge(input, output, new byte[READ_BUFFER_SIZE]);