« Return to the blog entry
Hi Chris,
The JPEG is sent to an output stream and then passed to a MIME-type field like so:
Stream stream = session.createStream();
stream.setContents(new ByteArrayInputStream(out.toByteArray()));
MIMEEntity Files = doc.createMIMEEntity("Files");
Files.setContentFromBytes(stream, "image/jpeg", MIMEEntity.ENC_IDENTITY_BINARY);
Perhaps I could skip the MIME stuff though and just use the server's disk (using the MIME trick above saves me having to use disk I/O operations).
Jake
Hi Chris,
The JPEG is sent to an output stream and then passed to a MIME-type field like so:
Stream stream = session.createStream();
stream.setContents(new ByteArrayInputStream(out.toByteArray()));
MIMEEntity Files = doc.createMIMEEntity("Files");
Files.setContentFromBytes(stream, "image/jpeg", MIMEEntity.ENC_IDENTITY_BINARY);
Perhaps I could skip the MIME stuff though and just use the server's disk (using the MIME trick above saves me having to use disk I/O operations).
Jake