I’ve had an interesting problem with FileOutputChannel and RandomAccessFile from Java NIO.

If I understand the API correctly, it is enough to position(pos) on a FileOutputChannel and then use transferFrom

However transferFrom always returned 0. Then I used setLength on the RandomAccessFile where the FileOutputChannel was derived from and then it worked.

This was for Java 1.6 developer preview on OS X 10.4, maybe it is not even a Problem on other systems.

Window locations in Java

Are you interested in reading more from CodingClues?
Then subscribe to new postings via RSS or via E-Mail.

close Reblog this comment
blog comments powered by Disqus