JDK-6892800 : [1.4.2] : IOException occurs when Pipe.SinkChannel is set to 3rd arg. of transferTo()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 1.4.2_20
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2009-10-19
  • Updated: 2011-02-16
  • Resolved: 2010-06-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4-poolResolved
Related Reports
Duplicate :  
Relates :  
Description
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)