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

FileChannel.transferTo(long p,long c,target) throws "value too large exception"

XMLWordPrintable

    • sparc
    • solaris_8

      checked in build 89 and PIT build 338.
      This method returns the number of bytes transfered , but the method return type is int. So when the number of bytes transfered is greater than 2^31-1 , it
      gives an exception :
      "java.io.IOException: Value too large for defined data type"

      public abstract int transferTo(long position,
                                     long count,
                                     WritableByteChannel target)
                              throws IOException

      The testcase transferTo1.java is attached.

      The similar problem is there for transferFrom method :
      public abstract int transferFrom(ReadableByteChannel src,
                                       long position,
                                       long count)
                                throws IOException
      the method returns an int value.

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: