-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta2
-
sparc
-
solaris_7
-
Verified
This method is introduced in nio spec v 0.39.
It throws NegativeArraySizeException when offset > length.
This is inconsistent with spec.
For example,
// write out remaining bytes from srcBuffers[2] only
fc.write(srcBuffers, 2, 1) ;
---------------------------
java.lang.NegativeArraySizeException
at sun.nio.ch.Util.subsequence(Util.java:22)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:179)
at FCgatheringWriteSubseq.writeGatheringTest02(FCgatheringWriteSubseq.java:254)
---------------------------
Also, when offset < length it does not write out correct data from src
Buffers to FileChannel.
For example,
// write out remaining bytes from srcBuffers[1] and srcBuffers[2]
fc.write(srcBuffers, 1, 2) ;
Merlin Build: 1.4.0-beta_refresh-b69
Same results on Solaris 8, Windows NT, RedHat Linux 6.2.
It throws NegativeArraySizeException when offset > length.
This is inconsistent with spec.
For example,
// write out remaining bytes from srcBuffers[2] only
fc.write(srcBuffers, 2, 1) ;
---------------------------
java.lang.NegativeArraySizeException
at sun.nio.ch.Util.subsequence(Util.java:22)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:179)
at FCgatheringWriteSubseq.writeGatheringTest02(FCgatheringWriteSubseq.java:254)
---------------------------
Also, when offset < length it does not write out correct data from src
Buffers to FileChannel.
For example,
// write out remaining bytes from srcBuffers[1] and srcBuffers[2]
fc.write(srcBuffers, 1, 2) ;
Merlin Build: 1.4.0-beta_refresh-b69
Same results on Solaris 8, Windows NT, RedHat Linux 6.2.