Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small commit before funking around

  • Loading branch information...
commit f3c89791484a2e2796e955d4895ea7e46d5f82e9 1 parent 808d57f
Jan Jongboom authored
Showing with 5 additions and 4 deletions.
  1. +1 −4 janzip.js
  2. +4 −0 rollingbuffer.js
5 janzip.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 {
4 rollingbuffer.js
View
@@ -44,6 +44,10 @@ function RollingBuffer (arg0, arg1, arg2) {
offset += 4;
};
+
+ this.getInternalBuffer = function () {
+ return this.buf;
+ };
}
module.exports = RollingBuffer;
Please sign in to comment.
Something went wrong with that request. Please try again.