From: adam Date: Thu, 5 Jul 2007 21:47:51 +0000 (+0000) Subject: improve logic for header-stripping in MIME.java X-Git-Url: http://git.megacz.com/?p=org.ibex.mail.git;a=commitdiff_plain;h=43b53fd9e204f99ff18101c029e8c3a3a7cf5763 improve logic for header-stripping in MIME.java darcs-hash:20070705214751-5007d-e6e30f99559379fd4159e10142a5e9bde9d212d3.gz --- diff --git a/src/org/ibex/mail/MIME.java b/src/org/ibex/mail/MIME.java index 5b62faa..477ce63 100644 --- a/src/org/ibex/mail/MIME.java +++ b/src/org/ibex/mail/MIME.java @@ -56,11 +56,10 @@ public class MIME { ctype = "application/octet-stream"; } this.contentType = new ContentType(ctype, headers.get("content-description"), headers.get("content-id"), encoding); - final long bodylength = fount.getLength() - h.getLength() - 2; /*CRLF*/ // FIXME: this is a horrible, tangled mess. this.body = new Fountain() { - public int getNumLines() { return Stream.countLines(getStream()); } - public long getLength() { return bodylength; } + public int getNumLines() { return Stream.countLines(this.getStream()); } + public long getLength() { return Stream.countBytes(this.getStream()); } public Stream getStream() { return transformBodyStream(Headers.skip(fount.getStream())); } }; this.all =