Hadoop FSDataInputStream 和FSDataOutputStream 用法

HDFS 常用IO操作 其实我经常用的也就那几种,记住几种特定适合自己的就行

public static void testIOUtils() throws IOException {
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
Path p = new Path("/test/in/point");
FSDataInputStream fdis = fs.open(p);
IOUtils.copyBytes(fdis, System.out, conf,false);
IOUtils.closeStream(fdis);
fs.close();
}

猜你喜欢

转载自blog.csdn.net/u010134642/article/details/47705895