var Transform = require('pipestream').Transform;
var util = require('util');
var iconv = require('iconv-lite');

function BufferTransform(data) {
	if (!(this instanceof BufferTransform)) {
		  return new BufferTransform(data);
	  }
	
	Transform.call(this);
	if (data.body) {
		var body = [];
		data.top && body.push(data.top);
		body.push(body);
		data.bottom && body.push(data.bottom);
		data.body = Buffer.concat(body);
	} else {
		this._top = data.top;
		this._bottom = data.bottom;
	}
}

util.inherits(BufferTransform, Transform);

BufferTransform.prototype._transform = function(chunk, encoding, callback) {
	if (this._ended || this._body) {
		callback(null, this._body);
		this._body = null;
		this._ended = true;
	} else if (this._top) {
		callback(null, chunk ? Buffer.concat([chunk, this._top]) : this._top);
		this._top = null;
	} else if (chunk == null && this._bottom) {
		callback(null, this._bottom);
		this._bottom = null;
	}
};

module.exports = BufferTransform;
@@ -106,16 +106,124 @@
 ite');%0A%0A
+function toBuffer(data) %7B%0A%09return data ? (data instanceof Buffer ? data : new Buffer(data + '')) : null;%0A%7D%0A%0A
 function
@@ -413,24 +413,33 @@
 & body.push(
+toBuffer(
 data.top);%0A%09
@@ -431,24 +431,25 @@
 er(data.top)
+)
 ;%0A%09%09body.pus
@@ -484,16 +484,25 @@
 dy.push(
+toBuffer(
 data.bot
@@ -501,24 +501,25 @@
 data.bottom)
+)
 ;%0A%09%09data.bod
@@ -536,21 +536,31 @@
 .concat(
+toBuffer(
 body)
+)
 ;%0A%09%7D els
@@ -577,24 +577,33 @@
 ._top = 
+toBuffer(
 data.top
 ;%0A%09%09this
@@ -594,16 +594,17 @@
 data.top
+)
 ;%0A%09%09this
@@ -614,16 +614,25 @@
 ottom = 
+toBuffer(
 data.bot
@@ -634,16 +634,17 @@
 a.bottom
+)
 ;%0A%09%7D%0A%7D%0A%0A

Add readFilesBuffer