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