ReadableByteChannel « nio « Java I/O Q&A

1. What can cause ReadableByteChannel.close() to block?

I'm attempting to run an external process with a timeout and read all of the output it produces. This is proving to be a surprisingly Herculean task. My basic strategy is ...

2. always returns -1

I am using ReadableByteChannel to read from a file. The code snippet is as below

   InputStream in = new FileInputStream("Copy.tiff");
   FileInputStream in1 = new FileInputStream("Copy.tiff");
   FileChannel ...