+ // FIXME: this is a horrible, tangled mess.
+ this.body = new Fountain() {
+ 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 =
+ keyval==null
+ ? fount
+ : Fountain.Util.concat(this.headers, Fountain.Util.create("\r\n"), this.body);
+ }
+
+ private Stream transformBodyStream(Stream body) {
+ //"quoted-printable".equals(encoding) ? Encode.QuotedPrintable.decode(body.toString(),false) :
+ //"base64".equals(encoding) ? Encode.fromBase64(body.toString()) :
+ return body;