(2)public static FileSystem get (URI uri,Configuration conf)
//参数URI指定URI方案及决定所用文件系统的权限,如果没有指定方案,则退回默认的文件系统
三、open()方法
public FSDataInputStream open(path f)
//该方法默认使用4kb的缓冲大小
public abstract FSDataInputStream open(Path f, int bufferSize)
//第二个参数指定缓冲大小
//open方法实际返回的是一个FSDataInputStream,这个类是java.io.DataInputStream的一个子类,支持随机访问,能从流中任意位置对其数据。
五、FSDataInputStream类实现了PositionedReadable接口
public int read(long position,byte[] buffer,int offset,int length)
//read()方法指定position读取指定长度的字节放入缓冲区buffer的指定偏移量offset,返回值是读到的字节数。
public int readFully(long position,byte[] buffer,int offset,int length)
//该方法读出字节length指定的数据到buffer。