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

Summary: GeneratedFilesHelper should preset size of ByteArrayOutputStream
Product: projects Reporter: Petr Nejedly <pnejedly>
Component: AntAssignee: Jesse Glick <jglick>
Status: CLOSED FIXED    
Severity: blocker Keywords: PERFORMANCE, SIMPLEFIX
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535    

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.