Java Reader Copy copyLarge(Reader input, Writer output)

Here you can find the source of copyLarge(Reader input, Writer output)

Description

copy Large

License

Open Source License

Declaration

public static long copyLarge(Reader input, Writer output) throws IOException 

Method Source Code


//package com.java2s;
import java.io.IOException;

import java.io.Reader;

import java.io.Writer;

public class Main {
    private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;

    public static long copyLarge(Reader input, Writer output) throws IOException {
        char[] buffer = new char[DEFAULT_BUFFER_SIZE];
        long count = 0;
        int n = 0;
        while (-1 != (n = input.read(buffer))) {
            output.write(buffer, 0, n);//from   www.j  a v  a  2 s  .  c o m
            count += n;
        }
        return count;
    }
}

Related

  1. copyLarge(final Reader input, final Writer output)
  2. copyLarge(Reader input, Writer output)
  3. copyLarge(Reader input, Writer output)
  4. copyLarge(Reader input, Writer output)
  5. copyLarge(Reader input, Writer output)
  6. copyLarge(Reader input, Writer output)
  7. copyLarge(Reader input, Writer output)
  8. copyLarge(Reader input, Writer output)