Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99F41D65C for ; Thu, 11 Oct 2012 02:17:03 +0000 (UTC) Received: (qmail 30534 invoked by uid 500); 11 Oct 2012 02:17:03 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 30330 invoked by uid 500); 11 Oct 2012 02:17:03 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 30320 invoked by uid 99); 11 Oct 2012 02:17:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 02:17:03 +0000 Date: Thu, 11 Oct 2012 02:17:02 +0000 (UTC) From: "David Bild (JIRA)" To: issues@commons.apache.org Message-ID: <1940044745.24022.1349921823281.JavaMail.jiratomcat@arcas> In-Reply-To: <579555336.24021.1349921702761.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (IO-349) Add array offset and length argument to FileUtils.writeByteArrayToFile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IO-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Bild updated IO-349: -------------------------- Attachment: add_OffsetAndLengthArguments_To_FileUtils_writeByteArrayToFile.patch > Add array offset and length argument to FileUtils.writeByteArrayToFile > ---------------------------------------------------------------------- > > Key: IO-349 > URL: https://issues.apache.org/jira/browse/IO-349 > Project: Commons IO > Issue Type: Improvement > Components: Utilities > Affects Versions: 2.4 > Reporter: David Bild > Labels: patch > Fix For: 2.5 > > Attachments: add_OffsetAndLengthArguments_To_FileUtils_writeByteArrayToFile.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > 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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira