I read from an input stream and in my finally block try to close it by calling in.close(); However the execution of main gets blocked . What is the way out ?
On suggestion , the code I used is ,
if (!processed) {
System.out.println("in processed");
byte[] contents = new byte[(int) fileSplit.getLength()];
Path file = fileSplit.getPath();
FileSystem fs = file.getFileSystem(conf);
FSDataInputStream in = null;
try {
in = fs.open(file);
IOUtils.readFully(in, contents, 0, contents.length);
value.set(contents, 0, contents.length);
} finally {
System.out.println("before close stream");
IOUtils.closeStream(in);
}
processed = true;
return true;
}
System.out.println("out of processed");
return false;
}