mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-26 01:28:50 -05:00
Backport a bit of memory efficiency I'm not sure I believe from AOSP
This commit is contained in:
parent
0bb115ca42
commit
134c0b23dd
@ -385,10 +385,12 @@ 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.
|
||||||
*/
|
*/
|
||||||
final InputStream in = part.getBody().getInputStream();
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
InputStream in = part.getBody().getInputStream();
|
||||||
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
|
||||||
|
// Cargo culted from AOSP - This disagrees with the platform docs
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert and return as new String
|
* Convert and return as new String
|
||||||
|
Loading…
Reference in New Issue
Block a user