1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Backport a bit of memory efficiency I'm not sure I believe from AOSP

This commit is contained in:
Jesse Vincent 2010-07-29 22:17:32 +00:00
parent 0bb115ca42
commit 134c0b23dd

View File

@ -385,10 +385,12 @@ 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.
*/
final InputStream in = part.getBody().getInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
InputStream in = part.getBody().getInputStream();
IOUtils.copy(in, out);
in.close();
in = null; // we want all of our memory back, and close might not release
// Cargo culted from AOSP - This disagrees with the platform docs
/*
* Convert and return as new String