use of com.fsck.k9.mail.filter.CountingOutputStream in project k-9 by k9mail.
the class Message method calculateSize.
public long calculateSize() {
try (CountingOutputStream out = new CountingOutputStream()) {
EOLConvertingOutputStream eolOut = new EOLConvertingOutputStream(out);
writeTo(eolOut);
eolOut.flush();
return out.getCount();
} catch (IOException | MessagingException e) {
Timber.e(e, "Failed to calculate a message size");
}
return 0;
}
use of com.fsck.k9.mail.filter.CountingOutputStream in project k-9 by k9mail.
the class TextBody method getLengthWhenQuotedPrintableEncoded.
private long getLengthWhenQuotedPrintableEncoded(byte[] bytes) throws IOException {
CountingOutputStream countingOutputStream = new CountingOutputStream();
writeSignSafeQuotedPrintable(countingOutputStream, bytes);
return countingOutputStream.getCount();
}
Aggregations