Permalink
Browse files

Small commit before funking around

  • Loading branch information...
1 parent 808d57f commit f3c89791484a2e2796e955d4895ea7e46d5f82e9 @janjongboom janjongboom committed Dec 28, 2011
Showing with 5 additions and 4 deletions.
  1. +1 −4 janzip.js
  2. +4 −0 rollingbuffer.js
View
@@ -101,7 +101,6 @@ var Zip = function () {
var fileHeader = getFileHeader(file, zipMethod.indicator, data);
// write files
- console.log(fileHeader.length)
var fileBuffer = new RollingBuffer(4 + fileHeader.length + file.name.length + data.length);
writeBytes(fileBuffer, [0x50, 0x4b, 0x03, 0x04]); // 4
fileBuffer.appendBuffer(fileHeader); // hmm...
@@ -132,8 +131,6 @@ var Zip = function () {
var totalDirLength = getTotalBufLength(dirBuffers);
var totalFileLength = getTotalBufLength(fileBuffers);
- console.log(totalDirLength, totalFileLength);
-
var dirEnd = new RollingBuffer(8 + 2 + 2 + 4 + 4 + 2);
writeBytes(dirEnd, [0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00]);
// total number of entries
@@ -151,7 +148,7 @@ var Zip = function () {
dirBuffers.forEach(function (b) { buffer.appendBuffer(b); });
buffer.appendBuffer(dirEnd);
- return buffer.buf;
+ return buffer.getInternalBuffer();
}
return {
View
@@ -44,6 +44,10 @@ function RollingBuffer (arg0, arg1, arg2) {
offset += 4;
};
+
+ this.getInternalBuffer = function () {
+ return this.buf;
+ };
}
module.exports = RollingBuffer;

0 comments on commit f3c8979

Please sign in to comment.