From 43b53fd9e204f99ff18101c029e8c3a3a7cf5763 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 5 Jul 2007 21:47:51 +0000 Subject: [PATCH] improve logic for header-stripping in MIME.java darcs-hash:20070705214751-5007d-e6e30f99559379fd4159e10142a5e9bde9d212d3.gz --- src/org/ibex/mail/MIME.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 = -- 1.7.10.4