mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 09:08:49 -05:00
Try to avoid a bunch of reallocations as we grow the temporary output stream by defining its size if we can get it
This commit is contained in:
parent
134c0b23dd
commit
d8a757faaf
@ -385,8 +385,8 @@ public class MimeUtility
|
|||||||
* Now we read the part into a buffer for further processing. Because
|
* Now we read the part into a buffer for further processing. Because
|
||||||
* the stream is now wrapped we'll remove any transfer encoding at this point.
|
* the stream is now wrapped we'll remove any transfer encoding at this point.
|
||||||
*/
|
*/
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
InputStream in = part.getBody().getInputStream();
|
InputStream in = part.getBody().getInputStream();
|
||||||
|
ByteArrayOutputStream out = new ByteArrayOutputStream(in.available());
|
||||||
IOUtils.copy(in, out);
|
IOUtils.copy(in, out);
|
||||||
in.close();
|
in.close();
|
||||||
in = null; // we want all of our memory back, and close might not release
|
in = null; // we want all of our memory back, and close might not release
|
||||||
|
Loading…
Reference in New Issue
Block a user