Commons IO
  1. Commons IO
  2. IO-349

Add API with array offset and length argument to FileUtils.writeByteArrayToFile

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Utilities
    • Labels:

      Description

      The FileUtils.writeByteArrayToFile method does not allow a subset of an array to be written to a file. Instead, the subset must be copied to a separate array, increasing the lines of code and (for all JVMs I know about) runtime.

      Sister methods that take an offset and length should be added, inline with the byte array-oriented methods in the Java standard library.

      Attached is a patch that implements FileUtils.writeByteArrayToFile(File file, byte[] data, int offset, int length) and FileUtils.writeByteArrayToFile(File file, byte[] data, int offset, int length, boolean append) and associated testcases in FileUtilsTestCase.java.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            David Bild
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development