I think you may need a buffer.flip() between lines 6 and 7. Another issue is that there's no guarantee that you will read the entire file with line 6 - you really need a loop to guarantee you keep reading until you reach the end of the file. The same is true if you were using traditional IO with arrays rather than Buffers. Or you could use a RandomAccessFile, which has a readFully() method, much easier.
Post by:autobot
Whatever. Here's a tiny ad:
a bit of art, as a gift, the permaculture playing cards