Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Buffer indication #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matcher-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function MatcherStream(patternDesc, matchFn) {
this.requiredLength = this.pattern.length;
if (patternDesc.requiredExtraSize) this.requiredLength += patternDesc.requiredExtraSize;

this.data = new Buffer('');
this.data = Buffer.from('');
this.bytesSoFar = 0;

this.matchFn = matchFn;
Expand Down Expand Up @@ -57,7 +57,7 @@ MatcherStream.prototype.checkDataChunk = function (ignoreMatchZero) {

var finished = this.matchFn ? this.matchFn(this.data, this.bytesSoFar) : true;
if (finished) {
this.data = new Buffer('');
this.data = Buffer.from('');
return;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/unzip-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function UnzipStream(options) {
stream.Transform.call(this);

this.options = options || {};
this.data = new Buffer('');
this.data = Buffer.from('');
this.state = states.STREAM_START;
this.skippedBytes = 0;
this.parsedEntity = null;
Expand Down Expand Up @@ -306,7 +306,7 @@ UnzipStream.prototype._prepareOutStream = function (vars, entry) {
};

if (!fileSizeKnown) {
var pattern = new Buffer(4);
var pattern = Buffer.alloc(4);
pattern.writeUInt32LE(SIG_DATA_DESCRIPTOR, 0);
var zip64Mode = vars.extra.zip64Mode;
var extraSize = zip64Mode ? 20 : 12;
Expand Down