306307308309310311312
else if (encoding.equalsIgnoreCase("binary") || encoding.equalsIgnoreCase("7bit") || encoding.equalsIgnoreCase("8bit")) return is; else throw new MessagingException("Unknown encoding: " + encoding); }
337338339340341342343
else if (encoding.equalsIgnoreCase("binary") || encoding.equalsIgnoreCase("7bit") || encoding.equalsIgnoreCase("8bit")) return os; else throw new MessagingException("Unknown encoding: " +encoding); }
374375376377378379380
189190191192193194195196197198
ByteOutputStream bos = new ByteOutputStream(); bos.write(is); content = bos.getBytes(); contentLength = bos.getCount(); } catch (IOException ioex) { throw new MessagingException("Error reading input stream", ioex); } } }
617618619620621622623624
try { setHeader("Content-Description", MimeUtility.fold(21, MimeUtility.encodeText(description, charset, null))); } catch (UnsupportedEncodingException uex) { throw new MessagingException("Encoding error", uex); } }
720721722723724725726
if (contentStream != null) return ((SharedInputStream)contentStream).newStream(0, -1); if (content != null) return new ByteArrayInputStream(content,start,contentLength); throw new MessagingException("No content"); }
900901902903904905906907
OutputStream wos = MimeUtility.encode(os, getEncoding()); getDataHandler().writeTo(wos); if(os!=wos) wos.flush(); // Needed to complete encoding } else { throw new MessagingException("no content"); } }
10801081108210831084108510861087
} setHeader("Content-Type", type); } } catch (IOException ex) { throw new MessagingException("IOException updating headers", ex); } }
144145146147148149150151
} prevline = line; } } while (line != null && line.length() > 0); } catch (IOException ioex) { throw new MessagingException("Error in input stream", ioex); } }
197198199200201202203204205206