Java IO与NIO的一些文件拷贝测试

测试代码:

package canghailan;

import java.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

/**
 * User: canghailan
 * Date: 11-12-9
 * Time: 下午12:38
 */
public class TestIO {
    public static void main(String[] args) throws IOException {
        File[] files = {
                new File("/home/canghailan/java-io-test/1"),
                new File("/home/canghailan/java-io-test/2"),
                new File("/home/canghailan/java-io-test/3")
        };

        int[] bufferSizes = {
                4 * 1024, 8 * 1024, 64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024
        };

        int times = 5;
        for (File file : files) {
            System.out.println("start test " + file.getName());
            long length = file.length();

            for (int bufferSize : bufferSizes) {
                File byBufferedStream =
                        new File(file.getParentFile(), file.getName() + "-BufferedStream-" + bufferSize);
                File byChannelTransfer =
                        new File(file.getParentFile(), file.getName() + "-ChannelTransfer-" + bufferSize);
                File byBufferedChannel =
                        new File(file.getParentFile(), file.getName() + "-BufferedChannel-" + bufferSize);

                for (int i = 0; i < times; ++i) {
                    long start, end, time;

                    start = System.currentTimeMillis();
                    copyByBufferedStream(file, byBufferedStream, bufferSize);
                    end = System.currentTimeMillis();
                    time = end - start;
                    System.out.println("copyByBufferedStream [" + BtoKB(bufferSize) + "]:" +
                            " copy " + length + "Bytes in " + time + "ms" +
                            " @" + getSpeed(length, time) + "KB/s");


                    start = System.currentTimeMillis();
                    copyByChannelTransfer(file, byChannelTransfer);
                    end = System.currentTimeMillis();
                    time = end - start;
                    System.out.println("copyByChannelTransfer[" + BtoKB(bufferSize) + "]:" +
                            " copy " + length + "Bytes in " + time + "ms" +
                            " @" + getSpeed(length, time) + "KB/s");


                    start = System.currentTimeMillis();
                    copyByBufferedChannel(file, byBufferedChannel, bufferSize);
                    end = System.currentTimeMillis();
                    time = end - start;
                    System.out.println("copyByBufferedChannel[" + BtoKB(bufferSize) + "]:" +
                            " copy " + length + "Bytes in " + time + "ms" +
                            " @" + getSpeed(length, time) + "KB/s");

                    System.out.println();
                }
                System.out.println();
            }
            System.out.println();
        }

    }

    private static void copyByBufferedStream(File src, File dst, int bufferSize) throws IOException {
        InputStream in = new FileInputStream(src);
        OutputStream out = new FileOutputStream(dst);

        byte[] buffer = new byte[bufferSize];
        for (; ; ) {
            int count = in.read(buffer);
            if (count == -1) {
                break;
            }
            out.write(buffer, 0, count);
        }

        in.close();
        out.flush();
        out.close();
    }

    private static void copyByChannelTransfer(File src, File dst) throws IOException {
        FileChannel in = new FileInputStream(src).getChannel();
        FileChannel out = new FileOutputStream(dst).getChannel();

        out.transferFrom(in, 0, in.size());

        in.close();
        out.close();
    }

    private static void copyByBufferedChannel(File src, File dst, int bufferSize) throws IOException {
        FileChannel in = new FileInputStream(src).getChannel();
        FileChannel out = new FileOutputStream(dst).getChannel();

        ByteBuffer buffer = ByteBuffer.allocate(bufferSize);
        for (; ; ) {
            int count = in.read(buffer);
            if (count == -1) {
                break;
            }
            buffer.flip();
            out.write(buffer);
            buffer.clear();
        }

        in.close();
        out.close();
    }

    private static float BtoKB(long bytes) {
        return (float) bytes / 1024;
    }

    private static float MStoS(long ms) {
        return (float) ms / 1000;
    }

    private static float getSpeed(long bytesInTime, long time) {
        return BtoKB(bytesInTime) / MStoS(time);
    }
}

测试环境:

canghailan@canghailan-N81Vf:~$ cat /proc/version
Linux version 3.0.0-13-generic (buildd@rothera) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011
canghailan@canghailan-N81Vf:~$ java -version
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Server VM (build 21.1-b02, mixed mode)

 结论:

1.用Java进行文件拷贝时,Stream与Channel性能上几乎没有差别。

2.Stream的Buffer不是越大越好,如上面数据显示4K,8K,64K,128K,256K时相差不多,1M时性能反有所下降。

 测试方法有错误之处,敬请指正。

 

[注]三个文件为随机选取的40K左右的图像文件,15M左右的PDF文件,130M左右的压缩包文件。

[附]测试结果:

start test 1

copyByBufferedStream [4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[4.0]: copy 41836Bytes in 6ms @6809.2446KB/s

copyByBufferedChannel[4.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[4.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[4.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[4.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [4.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[4.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByBufferedChannel[4.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

 

copyByBufferedStream [8.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [8.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [8.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[8.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [8.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[8.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [8.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[8.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByBufferedChannel[8.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

 

copyByBufferedStream [64.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [64.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [64.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[64.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[64.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[64.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

 

copyByBufferedStream [128.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[128.0]: copy 41836Bytes in 5ms @8171.0938KB/s

copyByBufferedChannel[128.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [128.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[128.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[128.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [128.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[128.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByBufferedChannel[128.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [128.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[128.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[128.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [128.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[128.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByBufferedChannel[128.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

 

copyByBufferedStream [256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [256.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[256.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByChannelTransfer[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [256.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[256.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [256.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[256.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[256.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

 

copyByBufferedStream [1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[1024.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[1024.0]: copy 41836Bytes in 3ms @13618.489KB/s

 

copyByBufferedStream [1024.0]: copy 41836Bytes in 3ms @13618.489KB/s

copyByChannelTransfer[1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByBufferedChannel[1024.0]: copy 41836Bytes in 0ms @InfinityKB/s

 

copyByBufferedStream [1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[1024.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByBufferedChannel[1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

 

copyByBufferedStream [1024.0]: copy 41836Bytes in 1ms @40855.47KB/s

copyByChannelTransfer[1024.0]: copy 41836Bytes in 0ms @InfinityKB/s

copyByBufferedChannel[1024.0]: copy 41836Bytes in 2ms @20427.734KB/s

 

 

 

start test 2

copyByBufferedStream [4.0]: copy 14675006Bytes in 46ms @311544.78KB/s

copyByChannelTransfer[4.0]: copy 14675006Bytes in 35ms @409458.88KB/s

copyByBufferedChannel[4.0]: copy 14675006Bytes in 142ms @100922.96KB/s

 

copyByBufferedStream [4.0]: copy 14675006Bytes in 402ms @35649.402KB/s

copyByChannelTransfer[4.0]: copy 14675006Bytes in 255ms @56200.24KB/s

copyByBufferedChannel[4.0]: copy 14675006Bytes in 114ms @125711.055KB/s

 

copyByBufferedStream [4.0]: copy 14675006Bytes in 191ms @75031.734KB/s

copyByChannelTransfer[4.0]: copy 14675006Bytes in 302ms @47453.844KB/s

copyByBufferedChannel[4.0]: copy 14675006Bytes in 287ms @49934.008KB/s

 

copyByBufferedStream [4.0]: copy 14675006Bytes in 226ms @63411.773KB/s

copyByChannelTransfer[4.0]: copy 14675006Bytes in 288ms @49760.63KB/s

copyByBufferedChannel[4.0]: copy 14675006Bytes in 311ms @46080.582KB/s

 

copyByBufferedStream [4.0]: copy 14675006Bytes in 626ms @22893.068KB/s

copyByChannelTransfer[4.0]: copy 14675006Bytes in 35ms @409458.88KB/s

copyByBufferedChannel[4.0]: copy 14675006Bytes in 60ms @238851.02KB/s

 

 

copyByBufferedStream [8.0]: copy 14675006Bytes in 34ms @421501.75KB/s

copyByChannelTransfer[8.0]: copy 14675006Bytes in 28ms @511823.56KB/s

copyByBufferedChannel[8.0]: copy 14675006Bytes in 100ms @143310.61KB/s

 

copyByBufferedStream [8.0]: copy 14675006Bytes in 1144ms @12527.15KB/s

copyByChannelTransfer[8.0]: copy 14675006Bytes in 441ms @32496.734KB/s

copyByBufferedChannel[8.0]: copy 14675006Bytes in 49ms @292470.62KB/s

 

copyByBufferedStream [8.0]: copy 14675006Bytes in 146ms @98157.95KB/s

copyByChannelTransfer[8.0]: copy 14675006Bytes in 430ms @33328.047KB/s

copyByBufferedChannel[8.0]: copy 14675006Bytes in 200ms @71655.305KB/s

 

copyByBufferedStream [8.0]: copy 14675006Bytes in 979ms @14638.469KB/s

copyByChannelTransfer[8.0]: copy 14675006Bytes in 36ms @398085.03KB/s

copyByBufferedChannel[8.0]: copy 14675006Bytes in 49ms @292470.62KB/s

 

copyByBufferedStream [8.0]: copy 14675006Bytes in 859ms @16683.422KB/s

copyByChannelTransfer[8.0]: copy 14675006Bytes in 36ms @398085.03KB/s

copyByBufferedChannel[8.0]: copy 14675006Bytes in 49ms @292470.62KB/s

 

 

copyByBufferedStream [64.0]: copy 14675006Bytes in 28ms @511823.56KB/s

copyByChannelTransfer[64.0]: copy 14675006Bytes in 27ms @530780.0KB/s

copyByBufferedChannel[64.0]: copy 14675006Bytes in 151ms @94907.69KB/s

 

copyByBufferedStream [64.0]: copy 14675006Bytes in 1131ms @12671.141KB/s

copyByChannelTransfer[64.0]: copy 14675006Bytes in 1133ms @12648.773KB/s

copyByBufferedChannel[64.0]: copy 14675006Bytes in 43ms @333280.47KB/s

 

copyByBufferedStream [64.0]: copy 14675006Bytes in 34ms @421501.75KB/s

copyByChannelTransfer[64.0]: copy 14675006Bytes in 232ms @61771.816KB/s

copyByBufferedChannel[64.0]: copy 14675006Bytes in 268ms @53474.105KB/s

 

copyByBufferedStream [64.0]: copy 14675006Bytes in 283ms @50639.793KB/s

copyByChannelTransfer[64.0]: copy 14675006Bytes in 273ms @52494.727KB/s

copyByBufferedChannel[64.0]: copy 14675006Bytes in 273ms @52494.727KB/s

 

copyByBufferedStream [64.0]: copy 14675006Bytes in 284ms @50461.48KB/s

copyByChannelTransfer[64.0]: copy 14675006Bytes in 316ms @45351.457KB/s

copyByBufferedChannel[64.0]: copy 14675006Bytes in 326ms @43960.31KB/s

 

 

copyByBufferedStream [128.0]: copy 14675006Bytes in 27ms @530780.0KB/s

copyByChannelTransfer[128.0]: copy 14675006Bytes in 28ms @511823.56KB/s

copyByBufferedChannel[128.0]: copy 14675006Bytes in 229ms @62581.05KB/s

 

copyByBufferedStream [128.0]: copy 14675006Bytes in 876ms @16359.658KB/s

copyByChannelTransfer[128.0]: copy 14675006Bytes in 35ms @409458.88KB/s

copyByBufferedChannel[128.0]: copy 14675006Bytes in 42ms @341215.72KB/s

 

copyByBufferedStream [128.0]: copy 14675006Bytes in 252ms @56869.285KB/s

copyByChannelTransfer[128.0]: copy 14675006Bytes in 255ms @56200.24KB/s

copyByBufferedChannel[128.0]: copy 14675006Bytes in 311ms @46080.582KB/s

 

copyByBufferedStream [128.0]: copy 14675006Bytes in 264ms @54284.32KB/s

copyByChannelTransfer[128.0]: copy 14675006Bytes in 858ms @16702.867KB/s

copyByBufferedChannel[128.0]: copy 14675006Bytes in 41ms @349538.06KB/s

 

copyByBufferedStream [128.0]: copy 14675006Bytes in 34ms @421501.75KB/s

copyByChannelTransfer[128.0]: copy 14675006Bytes in 248ms @57786.535KB/s

copyByBufferedChannel[128.0]: copy 14675006Bytes in 322ms @44506.4KB/s

 

 

copyByBufferedStream [256.0]: copy 14675006Bytes in 30ms @477702.03KB/s

copyByChannelTransfer[256.0]: copy 14675006Bytes in 28ms @511823.56KB/s

copyByBufferedChannel[256.0]: copy 14675006Bytes in 166ms @86331.695KB/s

 

copyByBufferedStream [256.0]: copy 14675006Bytes in 36ms @398085.03KB/s

copyByChannelTransfer[256.0]: copy 14675006Bytes in 895ms @16012.358KB/s

copyByBufferedChannel[256.0]: copy 14675006Bytes in 42ms @341215.72KB/s

 

copyByBufferedStream [256.0]: copy 14675006Bytes in 36ms @398085.03KB/s

copyByChannelTransfer[256.0]: copy 14675006Bytes in 301ms @47611.496KB/s

copyByBufferedChannel[256.0]: copy 14675006Bytes in 309ms @46378.84KB/s

 

copyByBufferedStream [256.0]: copy 14675006Bytes in 276ms @51924.133KB/s

copyByChannelTransfer[256.0]: copy 14675006Bytes in 305ms @46987.082KB/s

copyByBufferedChannel[256.0]: copy 14675006Bytes in 286ms @50108.6KB/s

 

copyByBufferedStream [256.0]: copy 14675006Bytes in 286ms @50108.6KB/s

copyByChannelTransfer[256.0]: copy 14675006Bytes in 271ms @52882.145KB/s

copyByBufferedChannel[256.0]: copy 14675006Bytes in 312ms @45932.887KB/s

 

 

copyByBufferedStream [1024.0]: copy 14675006Bytes in 69ms @207696.53KB/s

copyByChannelTransfer[1024.0]: copy 14675006Bytes in 27ms @530780.0KB/s

copyByBufferedChannel[1024.0]: copy 14675006Bytes in 167ms @85814.734KB/s

 

copyByBufferedStream [1024.0]: copy 14675006Bytes in 674ms @21262.701KB/s

copyByChannelTransfer[1024.0]: copy 14675006Bytes in 34ms @421501.75KB/s

copyByBufferedChannel[1024.0]: copy 14675006Bytes in 59ms @242899.33KB/s

 

copyByBufferedStream [1024.0]: copy 14675006Bytes in 236ms @60724.832KB/s

copyByChannelTransfer[1024.0]: copy 14675006Bytes in 272ms @52687.72KB/s

copyByBufferedChannel[1024.0]: copy 14675006Bytes in 606ms @23648.615KB/s

 

copyByBufferedStream [1024.0]: copy 14675006Bytes in 268ms @53474.105KB/s

copyByChannelTransfer[1024.0]: copy 14675006Bytes in 35ms @409458.88KB/s

copyByBufferedChannel[1024.0]: copy 14675006Bytes in 68ms @210750.88KB/s

 

copyByBufferedStream [1024.0]: copy 14675006Bytes in 312ms @45932.887KB/s

copyByChannelTransfer[1024.0]: copy 14675006Bytes in 220ms @65141.184KB/s

copyByBufferedChannel[1024.0]: copy 14675006Bytes in 294ms @48745.105KB/s

 

 

 

start test 3

copyByBufferedStream [4.0]: copy 133473839Bytes in 2550ms @51115.902KB/s

copyByChannelTransfer[4.0]: copy 133473839Bytes in 3118ms @41804.215KB/s

copyByBufferedChannel[4.0]: copy 133473839Bytes in 1926ms @67676.81KB/s

 

copyByBufferedStream [4.0]: copy 133473839Bytes in 2006ms @64977.84KB/s

copyByChannelTransfer[4.0]: copy 133473839Bytes in 2390ms @54537.883KB/s

copyByBufferedChannel[4.0]: copy 133473839Bytes in 2560ms @50916.23KB/s

 

copyByBufferedStream [4.0]: copy 133473839Bytes in 2537ms @51377.83KB/s

copyByChannelTransfer[4.0]: copy 133473839Bytes in 2506ms @52013.387KB/s

copyByBufferedChannel[4.0]: copy 133473839Bytes in 2254ms @57828.55KB/s

 

copyByBufferedStream [4.0]: copy 133473839Bytes in 2529ms @51540.35KB/s

copyByChannelTransfer[4.0]: copy 133473839Bytes in 2463ms @52921.453KB/s

copyByBufferedChannel[4.0]: copy 133473839Bytes in 2566ms @50797.17KB/s

 

copyByBufferedStream [4.0]: copy 133473839Bytes in 2552ms @51075.84KB/s

copyByChannelTransfer[4.0]: copy 133473839Bytes in 2944ms @44274.98KB/s

copyByBufferedChannel[4.0]: copy 133473839Bytes in 1911ms @68208.03KB/s

 

 

copyByBufferedStream [8.0]: copy 133473839Bytes in 2427ms @53706.445KB/s

copyByChannelTransfer[8.0]: copy 133473839Bytes in 2572ms @50678.67KB/s

copyByBufferedChannel[8.0]: copy 133473839Bytes in 2522ms @51683.402KB/s

 

copyByBufferedStream [8.0]: copy 133473839Bytes in 2377ms @54836.156KB/s

copyByChannelTransfer[8.0]: copy 133473839Bytes in 2571ms @50698.383KB/s

copyByBufferedChannel[8.0]: copy 133473839Bytes in 2400ms @54310.64KB/s

 

copyByBufferedStream [8.0]: copy 133473839Bytes in 2547ms @51176.11KB/s

copyByChannelTransfer[8.0]: copy 133473839Bytes in 2355ms @55348.426KB/s

copyByBufferedChannel[8.0]: copy 133473839Bytes in 2531ms @51499.625KB/s

 

copyByBufferedStream [8.0]: copy 133473839Bytes in 2394ms @54446.76KB/s

copyByChannelTransfer[8.0]: copy 133473839Bytes in 2494ms @52263.652KB/s

copyByBufferedChannel[8.0]: copy 133473839Bytes in 2336ms @55798.61KB/s

 

copyByBufferedStream [8.0]: copy 133473839Bytes in 2619ms @49769.207KB/s

copyByChannelTransfer[8.0]: copy 133473839Bytes in 2996ms @43506.523KB/s

copyByBufferedChannel[8.0]: copy 133473839Bytes in 1918ms @67959.09KB/s

 

 

copyByBufferedStream [64.0]: copy 133473839Bytes in 2399ms @54333.285KB/s

copyByChannelTransfer[64.0]: copy 133473839Bytes in 2984ms @43681.484KB/s

copyByBufferedChannel[64.0]: copy 133473839Bytes in 1943ms @67084.69KB/s

 

copyByBufferedStream [64.0]: copy 133473839Bytes in 3074ms @42402.586KB/s

copyByChannelTransfer[64.0]: copy 133473839Bytes in 2011ms @64816.285KB/s

copyByBufferedChannel[64.0]: copy 133473839Bytes in 2901ms @44931.246KB/s

 

copyByBufferedStream [64.0]: copy 133473839Bytes in 2125ms @61339.082KB/s

copyByChannelTransfer[64.0]: copy 133473839Bytes in 2321ms @56159.215KB/s

copyByBufferedChannel[64.0]: copy 133473839Bytes in 2343ms @55631.902KB/s

 

copyByBufferedStream [64.0]: copy 133473839Bytes in 2415ms @53973.312KB/s

copyByChannelTransfer[64.0]: copy 133473839Bytes in 2495ms @52242.707KB/s

copyByBufferedChannel[64.0]: copy 133473839Bytes in 2398ms @54355.94KB/s

 

copyByBufferedStream [64.0]: copy 133473839Bytes in 2477ms @52622.344KB/s

copyByChannelTransfer[64.0]: copy 133473839Bytes in 2477ms @52622.344KB/s

copyByBufferedChannel[64.0]: copy 133473839Bytes in 2359ms @55254.58KB/s

 

 

copyByBufferedStream [128.0]: copy 133473839Bytes in 2377ms @54836.156KB/s

copyByChannelTransfer[128.0]: copy 133473839Bytes in 3802ms @34283.414KB/s

copyByBufferedChannel[128.0]: copy 133473839Bytes in 1212ms @107545.83KB/s

 

copyByBufferedStream [128.0]: copy 133473839Bytes in 2565ms @50816.977KB/s

copyByChannelTransfer[128.0]: copy 133473839Bytes in 2431ms @53618.08KB/s

copyByBufferedChannel[128.0]: copy 133473839Bytes in 2461ms @52964.465KB/s

 

copyByBufferedStream [128.0]: copy 133473839Bytes in 2471ms @52750.12KB/s

copyByChannelTransfer[128.0]: copy 133473839Bytes in 2766ms @47124.203KB/s

copyByBufferedChannel[128.0]: copy 133473839Bytes in 2469ms @52792.848KB/s

 

copyByBufferedStream [128.0]: copy 133473839Bytes in 2644ms @49298.617KB/s

copyByChannelTransfer[128.0]: copy 133473839Bytes in 3783ms @34455.6KB/s

copyByBufferedChannel[128.0]: copy 133473839Bytes in 1508ms @86436.04KB/s

 

copyByBufferedStream [128.0]: copy 133473839Bytes in 2272ms @57370.4KB/s

copyByChannelTransfer[128.0]: copy 133473839Bytes in 2835ms @45977.266KB/s

copyByBufferedChannel[128.0]: copy 133473839Bytes in 1910ms @68243.74KB/s

 

 

copyByBufferedStream [256.0]: copy 133473839Bytes in 2519ms @51744.957KB/s

copyByChannelTransfer[256.0]: copy 133473839Bytes in 2437ms @53486.066KB/s

copyByBufferedChannel[256.0]: copy 133473839Bytes in 2844ms @45831.766KB/s

 

copyByBufferedStream [256.0]: copy 133473839Bytes in 1937ms @67292.484KB/s

copyByChannelTransfer[256.0]: copy 133473839Bytes in 3068ms @42485.508KB/s

copyByBufferedChannel[256.0]: copy 133473839Bytes in 1863ms @69965.4KB/s

 

copyByBufferedStream [256.0]: copy 133473839Bytes in 2923ms @44593.07KB/s

copyByChannelTransfer[256.0]: copy 133473839Bytes in 2041ms @63863.574KB/s

copyByBufferedChannel[256.0]: copy 133473839Bytes in 2744ms @47502.023KB/s

 

copyByBufferedStream [256.0]: copy 133473839Bytes in 1996ms @65303.38KB/s

copyByChannelTransfer[256.0]: copy 133473839Bytes in 2904ms @44884.83KB/s

copyByBufferedChannel[256.0]: copy 133473839Bytes in 1930ms @67536.555KB/s

 

copyByBufferedStream [256.0]: copy 133473839Bytes in 2343ms @55631.902KB/s

copyByChannelTransfer[256.0]: copy 133473839Bytes in 2616ms @49826.28KB/s

copyByBufferedChannel[256.0]: copy 133473839Bytes in 2364ms @55137.707KB/s

 

 

copyByBufferedStream [1024.0]: copy 133473839Bytes in 3832ms @34015.016KB/s

copyByChannelTransfer[1024.0]: copy 133473839Bytes in 1350ms @96552.26KB/s

copyByBufferedChannel[1024.0]: copy 133473839Bytes in 2433ms @53574.0KB/s

 

copyByBufferedStream [1024.0]: copy 133473839Bytes in 3905ms @33379.14KB/s

copyByChannelTransfer[1024.0]: copy 133473839Bytes in 1225ms @106404.52KB/s

copyByBufferedChannel[1024.0]: copy 133473839Bytes in 2378ms @54813.098KB/s

 

copyByBufferedStream [1024.0]: copy 133473839Bytes in 3048ms @42764.285KB/s

copyByChannelTransfer[1024.0]: copy 133473839Bytes in 2069ms @62999.297KB/s

copyByBufferedChannel[1024.0]: copy 133473839Bytes in 2462ms @52942.953KB/s

 

copyByBufferedStream [1024.0]: copy 133473839Bytes in 3113ms @41871.363KB/s

copyByChannelTransfer[1024.0]: copy 133473839Bytes in 1963ms @66401.195KB/s

copyByBufferedChannel[1024.0]: copy 133473839Bytes in 2496ms @52221.773KB/s

 

copyByBufferedStream [1024.0]: copy 133473839Bytes in 3672ms @35497.152KB/s

copyByChannelTransfer[1024.0]: copy 133473839Bytes in 1301ms @100188.734KB/s

copyByBufferedChannel[1024.0]: copy 133473839Bytes in 2364ms @55137.707KB/s

转载于:https://my.oschina.net/canghailan/blog/36826

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值