mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-07 10:40:11 -05:00
Avoid string concatenation in Writer.write
This commit is contained in:
parent
f7d0f6090b
commit
e93510b4b3
@ -109,7 +109,10 @@ public class MimeHeader {
|
|||||||
v = EncoderUtil.encodeEncodedWord(field.value, charset);
|
v = EncoderUtil.encodeEncodedWord(field.value, charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.write(field.name + ": " + v + "\r\n");
|
writer.write(field.name);
|
||||||
|
writer.write(": ");
|
||||||
|
writer.write(v);
|
||||||
|
writer.write("\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writer.flush();
|
writer.flush();
|
||||||
|
@ -70,22 +70,29 @@ public class MimeMultipart extends Multipart {
|
|||||||
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out), 1024);
|
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out), 1024);
|
||||||
|
|
||||||
if (mPreamble != null) {
|
if (mPreamble != null) {
|
||||||
writer.write(mPreamble + "\r\n");
|
writer.write(mPreamble);
|
||||||
|
writer.write("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mParts.isEmpty()) {
|
if (mParts.isEmpty()) {
|
||||||
writer.write("--" + mBoundary + "\r\n");
|
writer.write("--");
|
||||||
|
writer.write(mBoundary);
|
||||||
|
writer.write("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0, count = mParts.size(); i < count; i++) {
|
for (int i = 0, count = mParts.size(); i < count; i++) {
|
||||||
BodyPart bodyPart = mParts.get(i);
|
BodyPart bodyPart = mParts.get(i);
|
||||||
writer.write("--" + mBoundary + "\r\n");
|
writer.write("--");
|
||||||
|
writer.write(mBoundary);
|
||||||
|
writer.write("\r\n");
|
||||||
writer.flush();
|
writer.flush();
|
||||||
bodyPart.writeTo(out);
|
bodyPart.writeTo(out);
|
||||||
writer.write("\r\n");
|
writer.write("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.write("--" + mBoundary + "--\r\n");
|
writer.write("--");
|
||||||
|
writer.write(mBoundary);
|
||||||
|
writer.write("--\r\n");
|
||||||
writer.flush();
|
writer.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user