Simplification

pull/168/head
M66B 5 years ago
parent 85fc6494d3
commit d92777b692

@ -1617,16 +1617,8 @@ public class FragmentCompose extends FragmentBase {
}; };
bpContent.setContent(imessage.getContent(), imessage.getContentType()); 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)) { try (OutputStream out = new FileOutputStream(input)) {
out.write(raw.getBytes()); bpContent.writeTo(out);
} }
} else { } else {
// Serialize message // Serialize message

Loading…
Cancel
Save