Example usage for org.apache.zookeeper.common IOUtils copyBytes

List of usage examples for org.apache.zookeeper.common IOUtils copyBytes

Introduction

In this page you can find the example usage for org.apache.zookeeper.common IOUtils copyBytes.

Prototype

public static void copyBytes(InputStream in, OutputStream out, int buffSize, boolean close) throws IOException 

Source Link

Document

Copies from one stream to another.

Usage

From source file:tlfdetail.query.TLFDetailQuery.java

void showResult(String path, Configuration conf) throws IOException {
    FileSystem fs = FileSystem.get(URI.create(path), conf);
    FSDataInputStream in = null;/*from  w ww  . j  a v a 2s  .c o  m*/
    try {
        in = fs.open(new Path(path));
        while (in.available() > 0)
            IOUtils.copyBytes(in, System.out, 217, true);
    } finally {
        IOUtils.closeStream(in);
    }
}