This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46235 - GeneratedFilesHelper should preset size of ByteArrayOutputStream
Summary: GeneratedFilesHelper should preset size of ByteArrayOutputStream
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE, SIMPLEFIX
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-07-16 13:08 UTC by Petr Nejedly
Modified: 2006-03-24 10:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2004-07-16 13:08:21 UTC
ant/project issue
ByteOutoutStream defaults to 32B, vhich is way too
low for GFH. It causes several reallocations with
memcopies.
If the GFH knows future size (as in case of
reading a file into a byte array), it should tell
it to the BAOS constructor.
Comment 1 Jesse Glick 2004-07-16 21:22:00 UTC
OK, I will use InputStream.available() as an estimate.
Comment 2 Jesse Glick 2004-07-16 23:36:34 UTC
committed     Up-To-Date  1.6        
ant/project/src/org/netbeans/spi/project/support/ant/GeneratedFilesHelper.java
Comment 3 Petr Nejedly 2004-07-19 09:20:49 UTC
OK.
I thought you'll use file size, but it seems that available()
returns correct value.