6 Replies Latest reply on Mar 11, 2011 12:24 AM by EJP

    FileChannel.write(ByteBuffer[]) only writes out the first 16 ByteBuffer

    shawnstc
      Hi,
      This does NOT happen on Windows. I've only had this problem on Solaris (10 u8).
      I've tried this in jdk1.4, 1.5 and 1.6. All showed the same behavior on Solaris.
      I tried to write bytes to a file using FileChannel.write(ByteBuffer[]) method.
      I noticed that, if the ByteBuffer array contains more than 16 ByteBuffer, the FileChannel.write(ByteBuffer[] src) method only writes out contents of the first 16 ByteBuffer (src[0] thru src[15]).
      It worked fine if I combined all bytes into a single (big) ByteBuffer. (FileChannel.write(ByteBuffer) works fine)
      Has anyone experienced similar problem? Is it a bug in the JRE?

      Thanks.