I'm exporting MIME eMails with the following code:

```
    public String fromRawMime(final Session s, final Document doc) throws NotesException {
        final Stream notesStream = s.createStream();
        final MIMEEntity rootMime = doc.getMIMEEntity();

        // check if it is multi-part or single
        if (rootMime.getContentType().equals("multipart")) {
            this.printMIME(rootMime, notesStream);
        } else {
            // We can just write the content into the
            // Notes stream to get the bytes
            rootMime.getEntityAsText(notesStream);
        }

        // Write it out
        notesStream.setPosition(0);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        out.append(notesStream.read());
        notesStream.close();

        notesStream.recycle();
        rootMime.recycle();

        return out.toString();
    }

    // Write out a mime entry to a Stream object, includes sub entries
    private void printMIME(final MIMEEntity mimeRoot, final Stream out) throws NotesException {
        if (mimeRoot == null) {
            return;
        }

        // Encode binary as base64
        if (mimeRoot.getEncoding() == MIMEEntity.ENC_IDENTITY_BINARY) {
            mimeRoot.decodeContent();
            mimeRoot.encodeContent(MIMEEntity.ENC_BASE64);
        }

        out.writeText(mimeRoot.getBoundaryStart(), Stream.EOL_NONE);
        mimeRoot.getEntityAsText(out);
        out.writeText(mimeRoot.getBoundaryEnd(), Stream.EOL_NONE);

        if (mimeRoot.getContentType().equalsIgnoreCase("multipart")) {
            // Print preamble if it isn't empty
            final String preamble = mimeRoot.getPreamble();
            if (!preamble.isEmpty()) {
                out.writeText(preamble, Stream.EOL_NONE);
            }

            // Print content of each child entity - recursive calls
            // Include recycle of mime elements
            MIMEEntity mimeChild = mimeRoot.getFirstChildEntity();
            while (mimeChild != null) {
                this.printMIME(mimeChild, out);
                final MIMEEntity mimeNext = mimeChild.getNextSibling();
                // Recycle to ensure we don't bleed memory
                mimeChild.recyle();
                mimeChild = mimeNext;
            }
        }
    }

```

The result contains one empty line for each line. Including the content that gets added using `getEntityAsText`. What am I missing to get rid of the extra lines?