import java.io.FileOutputStream;
import java.io.OutputStream;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
public static void main(String[] args) throws Exception
{String dest = "hdfs://master001:9000/zhaimo/test62015_09_17_04_38_02/part-r-00000";
String local = "d:\\test16.txt";
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(URI.create(dest),conf);
FSDataInputStream fsdi = fs.open(new Path(dest));
OutputStream output = new FileOutputStream(local);
IOUtils.copyBytes(fsdi,output,4096,true);
}