Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6892800

[1.4.2] : IOException occurs when Pipe.SinkChannel is set to 3rd arg. of transferTo()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.4.2_20
    • Fix Version/s: 1.4-pool
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      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)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                karunakar Karunakar Gajjala (Inactive)
                Reporter:
                tbaba Tadayuki Baba (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: