Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338169

Summary: Use a BufferedOutputStream in AdaptorUtil#readFile
Product: [Eclipse Project] Equinox Reporter: Mariot Chauvin <mariot.chauvin>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P3 CC: john.arthorne
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch for HEAD none

Description Mariot Chauvin CLA 2011-02-24 19:52:28 EST
Created attachment 189765 [details]
patch for HEAD

I may miss something obvious, but I think AdaptorUtil#readFile could use a buffered output stream, which should enhance performance when writing big files.

This method seems to be called often by the framework, through org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.
Comment 1 John Arthorne CLA 2011-02-25 09:41:25 EST
It is already using a 1KB buffer for writing, so an extra buffered stream isn't needed. Although for what it's worth, when I tested this in the past I found a larger buffer such as 4-8KB was much faster than a 1KB buffer, but that depends on the size of the file you're writing.
Comment 2 Mariot Chauvin CLA 2011-02-25 10:43:46 EST
(In reply to comment #1)
> It is already using a 1KB buffer for writing, so an extra buffered stream isn't
> needed.

Clearly see it today, sorry for the noise, missed something obvious.