Hi all,

For some reasons, I need to read a small fine into memory from HDFS. I tried:

    final Path file = new Path(...) // file name on HDFS
    byte[] buffer = new byte[100000];
    try {
        FileSystem fs = FileSystem.get(conf);
        FSDataInputStream fileIn = fs.open(file);
        fileIn.readFully(buffer);
    } catch (Exception e) {
        System.err.println(e.toString());
    }

but the "fileIn.readFully(buffer)" always throws a EOF exception.

Any suggestions on that? Thank you.


-- 
Frank Lin
Undergraduate Student
Dept. Computer Science and Technology,
Tsinghua University, Beijing, P.R.China

Reply via email to