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