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

Method encode

app/src/main/java/javax/mail/internet/MimeUtility.java:398–416  ·  view source on GitHub ↗

Wrap an encoder around the given output stream. All the encodings defined in RFC 2045 are supported here. They include "base64", "quoted-printable", "7bit", "8bit" and "binary". In addition, "uuencode" is also supported. @param os output stream @param encoding the encoding of the stream. @return

(OutputStream os, String encoding)

Source from the content-addressed store, hash-verified

396 * @exception MessagingException if the encoding is unknown
397 */
398 public static OutputStream encode(OutputStream os, String encoding)
399 throws MessagingException {
400 if (encoding == null)
401 return os;
402 else if (encoding.equalsIgnoreCase("base64"))
403 return new BASE64EncoderStream(os);
404 else if (encoding.equalsIgnoreCase("quoted-printable"))
405 return new QPEncoderStream(os);
406 else if (encoding.equalsIgnoreCase("uuencode") ||
407 encoding.equalsIgnoreCase("x-uuencode") ||
408 encoding.equalsIgnoreCase("x-uue"))
409 return new UUEncoderStream(os);
410 else if (encoding.equalsIgnoreCase("binary") ||
411 encoding.equalsIgnoreCase("7bit") ||
412 encoding.equalsIgnoreCase("8bit"))
413 return os;
414 else
415 throw new MessagingException("Unknown encoding: " +encoding);
416 }
417
418 /**
419 * Wrap an encoder around the given output stream.

Callers 10

writeToMethod · 0.95
prism.jsFile · 0.45
onExecutedMethod · 0.45
sanitizeMethod · 0.45
onActionUrlMethod · 0.45
generateMethod · 0.45
_getMethod · 0.45
callMethod · 0.45
translateMethod · 0.45
fromStringArrayMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected