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

(fc) FileChannel.transferTo() transfers no more than Integer.MAX_VALUE bytes in one call

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b10
    • CPU:
      generic
    • OS:
      generic

      Description

      The transferTo() method in sun.nio.fs.FileChannelImpl clamps the number of bytes to transfer to Integer.MAX_VALUE:

              int icount = (int)Math.min(count, Integer.MAX_VALUE);
              if ((sz - position) < icount)
                  icount = (int)(sz - position);

      The attached test class "Transfer2GPlus" verifies this problem.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              bpb Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: