| 4157 | } |
| 4158 | |
| 4159 | @Override |
| 4160 | public void writeTo(OutputStream os) throws IOException { |
| 4161 | // the message should not change between the constructor and this call |
| 4162 | try { |
| 4163 | if (buf != null) |
| 4164 | os.write(buf, 0, msgSize); |
| 4165 | else { |
| 4166 | os = new CRLFOutputStream(os); |
| 4167 | msg.writeTo(os); |
| 4168 | } |
| 4169 | } catch (MessagingException mex) { |
| 4170 | // exceptions here are bad, "should" never happen |
| 4171 | throw new IOException("MessagingException while appending message: " |
| 4172 | + mex); |
| 4173 | } |
| 4174 | } |
| 4175 | } |
| 4176 | |
| 4177 | /** |