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 DFBC69C63 for ; Sat, 17 Mar 2012 12:00:00 +0000 (UTC) Received: (qmail 35416 invoked by uid 500); 17 Mar 2012 11:59:59 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 35344 invoked by uid 500); 17 Mar 2012 11:59:59 -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 35336 invoked by uid 99); 17 Mar 2012 11:59:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Mar 2012 11:59:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Mar 2012 11:59:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 72A9024C29 for ; Sat, 17 Mar 2012 11:59:38 +0000 (UTC) Date: Sat, 17 Mar 2012 11:59:38 +0000 (UTC) From: "Sebb (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <1090870093.27933.1331985578471.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1730780015.32695.1331115297892.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (IO-305) New copy() method in IOUtils that takes additional offset, length and buffersize arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IO-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231927#comment-13231927 ] Sebb commented on IO-305: ------------------------- The default buffer size of 4096 was chosen because it gives good performance. Have you any performance tests that show otherwise? If so, we can consider implementing this for all the copyLarge methods, see: IO-308 bq. Is the check for len == -1 really a performance issue Code no longer checks the length twice; I reimplemented the loop in order to support returning the copied length. > New copy() method in IOUtils that takes additional offset, length and buffersize arguments > ------------------------------------------------------------------------------------------ > > Key: IO-305 > URL: https://issues.apache.org/jira/browse/IO-305 > Project: Commons IO > Issue Type: New Feature > Components: Utilities > Reporter: Manoj Mokashi > Priority: Minor > Fix For: 2.2 > > Attachments: IOUtils.java, IOUtilsTest.java > > > /** > * Copy from input to output stream > * @param is : input stream > * @param os : output stream > * @param offset : number of bytes to skip from input before copying > * -ve values are ignored > * @param len : number of bytes to copy. -1 means all > * @param bufferSize : buffer size to use for copying > * @throws IOException > */ > public static void copy( InputStream is, OutputStream os, int offset, int len, int bufferSize) throws IOException > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira