When user sets Pipe.SinkChannel to 3rd arg. of transferTo(),
IOException occurs.
CONFIGURATION:
OS : Solaris 10/Fedora9
JDK : 1.4.2_20
REPRODUCE:
1. Compile the attached transferToPipe.java
2. Invoke java transferToPipe <org file> <target file> as follows.
Than you can see an IOException
[guest@dunga]$ java -showversion transferToPipe from to3
java version "1.4.2_20"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_20-b03)
Java HotSpot(TM) Client VM (build 1.4.2_20-b03, mixed mode)
transferTo : pos=0, len=3854, pos+len=3854
Client
java.io.IOException: Invalid argument
at sun.nio.ch.FileChannelImpl.transferTo0(Native Method)
at sun.nio.ch.FileChannelImpl.transferToDirectly(FileChannelImpl.java:39
2)
at sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:487)
at transferToPipe.main(transferToPipe.java:55)
Server
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkBounds(Buffer.java:454)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:125)
at transferToPipe$Server.run(transferToPipe.java:108)
IOException occurs.
CONFIGURATION:
OS : Solaris 10/Fedora9
JDK : 1.4.2_20
REPRODUCE:
1. Compile the attached transferToPipe.java
2. Invoke java transferToPipe <org file> <target file> as follows.
Than you can see an IOException
[guest@dunga]$ java -showversion transferToPipe from to3
java version "1.4.2_20"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_20-b03)
Java HotSpot(TM) Client VM (build 1.4.2_20-b03, mixed mode)
transferTo : pos=0, len=3854, pos+len=3854
Client
java.io.IOException: Invalid argument
at sun.nio.ch.FileChannelImpl.transferTo0(Native Method)
at sun.nio.ch.FileChannelImpl.transferToDirectly(FileChannelImpl.java:39
2)
at sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:487)
at transferToPipe.main(transferToPipe.java:55)
Server
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkBounds(Buffer.java:454)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:125)
at transferToPipe$Server.run(transferToPipe.java:108)
- duplicates
-
JDK-6896219 (fc) FileChannel.transferTo to DatagramChannel fails with "Operation not supported" (sol)
- Closed
- relates to
-
JDK-5056395 nio does not seem to work with Linux kernel 2.6.4 (and probably above)
- Resolved