Commons IO
  1. Commons IO
  2. IO-223

IOUtils.copy Javadoc inconsistency (return -1 vs. throw ArithmeticException)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3, 1.3.1, 1.3.2, 1.4
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None

      Description

      The javadoc for IOUtils.copy says:
      "Large streams (over 2GB) will return a bytes copied value of -1 after the copy has completed since the correct number of bytes cannot be returned as an int."
      but then it says:
      "Throws:
      ArithmeticException - if the byte count is too large"
      This is an inconsistency since -1 is always returned if the byte count is too large. ArithmeticException is never actually thrown.

      See IO-84 for discussion on solving the "too large byte count" problem.

        Activity

        Sebb made changes -
        Fix Version/s 2.0 [ 12312961 ]
        Mark Thomas made changes -
        Workflow jira [ 12482268 ] Default workflow, editable Closed status [ 12601734 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Sebb made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Adam Michalik created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Adam Michalik
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development