MCPcopy Create free account
hub / github.com/M66B/FairEmail / writeTo

Method writeTo

app/src/main/java/com/sun/mail/imap/IMAPMessage.java:908–930  ·  view source on GitHub ↗

Write out the bytes into the given OutputStream.

(OutputStream os)

Source from the content-addressed store, hash-verified

906 * Write out the bytes into the given OutputStream.
907 */
908 @Override
909 public void writeTo(OutputStream os)
910 throws IOException, MessagingException {
911 if (bodyLoaded) {
912 super.writeTo(os);
913 return;
914 }
915 InputStream is = getMimeStream();
916 if (this instanceof IMAPNestedMessage) {
917 String encoding = getEncoding();
918 if (encoding != null)
919 is = MimeUtility.decode(is, encoding);
920 }
921 try {
922 // write out the bytes
923 byte[] bytes = new byte[16*1024];
924 int count;
925 while ((count = is.read(bytes)) != -1)
926 os.write(bytes, 0, count);
927 } finally {
928 is.close();
929 }
930 }
931
932 /**
933 * Get the named header.

Callers 1

onRawMethod · 0.95

Calls 7

getMimeStreamMethod · 0.95
getEncodingMethod · 0.95
decodeMethod · 0.95
writeToMethod · 0.65
readMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected