1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04: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:
Jesse Vincent 2010-07-29 22:17:35 +00:00
parent 134c0b23dd
commit d8a757faaf

View File

@ -385,8 +385,8 @@ public class MimeUtility
* 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.
*/
ByteArrayOutputStream out = new ByteArrayOutputStream();
InputStream in = part.getBody().getInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream(in.available());
IOUtils.copy(in, out);
in.close();
in = null; // we want all of our memory back, and close might not release