-
Bug
-
Resolution: Fixed
-
P3
-
1.4.1
-
mantis
-
sparc
-
solaris_8
-
Verified
build 14
--------
FileChannel.write(ByteBuffer src,long position) accepts position = -1 . Also the postion of filechannel is modified after the execution.
It does not accept other non-negative values.
outputs:
if postion is -1
----------------
byte written- > 1000
size- > 1000
position- > 1000 -->the postion is modified
if postion is 1
----------------
byte written- > 1000
size- > 1001
position- > 0
if postion is -2
-----------------
FAIL java.io.IOException: Invalid argument
java.io.IOException: Invalid argument
at sun.nio.ch.FileDispatcher.pwrite0(Native Method)
at sun.nio.ch.FileDispatcher.pwrite(FileDispatcher.java:45)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:96)
at sun.nio.ch.IOUtil.write(IOUtil.java:74)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:609)
at FCWrite.main(FCWrite.java:16)
The testcase FCWrite.java is attached
--------
FileChannel.write(ByteBuffer src,long position) accepts position = -1 . Also the postion of filechannel is modified after the execution.
It does not accept other non-negative values.
outputs:
if postion is -1
----------------
byte written- > 1000
size- > 1000
position- > 1000 -->the postion is modified
if postion is 1
----------------
byte written- > 1000
size- > 1001
position- > 0
if postion is -2
-----------------
FAIL java.io.IOException: Invalid argument
java.io.IOException: Invalid argument
at sun.nio.ch.FileDispatcher.pwrite0(Native Method)
at sun.nio.ch.FileDispatcher.pwrite(FileDispatcher.java:45)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:96)
at sun.nio.ch.IOUtil.write(IOUtil.java:74)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:609)
at FCWrite.main(FCWrite.java:16)
The testcase FCWrite.java is attached