Close stream when done (StrictMode error)

This commit is contained in:
Joe Steele 2013-08-07 19:20:49 -04:00
parent d8030eaa7c
commit 564195bad9
1 changed files with 7 additions and 3 deletions

View File

@ -4010,11 +4010,15 @@ public class LocalStore extends Store implements Serializable {
@Override
public void writeTo(OutputStream out) throws IOException, MessagingException {
InputStream in = getInputStream();
Base64OutputStream base64Out = new Base64OutputStream(out);
try {
IOUtils.copy(in, base64Out);
Base64OutputStream base64Out = new Base64OutputStream(out);
try {
IOUtils.copy(in, base64Out);
} finally {
base64Out.close();
}
} finally {
base64Out.close();
in.close();
}
}