Simplification

This commit is contained in:
M66B 2019-12-04 08:57:36 +01:00
parent 85fc6494d3
commit d92777b692
1 changed files with 1 additions and 9 deletions

View File

@ -1617,16 +1617,8 @@ public class FragmentCompose extends FragmentBase {
};
bpContent.setContent(imessage.getContent(), imessage.getContentType());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bpContent.writeTo(bos);
// Just to be sure
String raw = new String(bos.toByteArray());
raw.replaceAll(" +$", "") // trim trailing spaces
.replace("\\r?\\n", "\\r\\n"); // normalize new lines
try (OutputStream out = new FileOutputStream(input)) {
out.write(raw.getBytes());
bpContent.writeTo(out);
}
} else {
// Serialize message