Skip to content

Commit

Permalink
references: add offset to pull
Browse files Browse the repository at this point in the history
Refs: #23
  • Loading branch information
Fishrock123 committed Jun 5, 2019
1 parent 679c9e5 commit 7e1b0b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion reference-buffered-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BufferedTransform {
}
}

pull (error, buffer) {
pull (error, buffer /*, offset */) {
if (this._bytes === 0) {
return this.source.pull(error, buffer)
}
Expand Down
2 changes: 1 addition & 1 deletion reference-extension-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class StartExtensionSink extends Sink {
// sink handles buffer allocation
const buffer = new Buffer(0)

this.source.pull(null, buffer)
this.source.pull(null, buffer, 0)
}
}

Expand Down
4 changes: 2 additions & 2 deletions reference-passthrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class PassThrough {
this.sink.next(status, error, buffer, bytes)
}

pull (error, buffer) {
this.source.pull(error, buffer)
pull (error, buffer, offset) {
this.source.pull(error, buffer, offset)
}
}

Expand Down
2 changes: 1 addition & 1 deletion reference-sink.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Sink {
// sink handles buffer allocation
const buffer = new Buffer(0)

this.source.pull(null, buffer)
this.source.pull(null, buffer, 0)
}

next (status, error, buffer, bytes) {
Expand Down
3 changes: 2 additions & 1 deletion reference-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ class Source {
this.sink = sink
}

pull (error, buffer) {
pull (error, buffer, offset) {
// error MUST be null or an error
// buffer MUST be a Buffer
// if offset exists, use it if possible
if (error || sourceError) {
return this.sink.next(status_type.error, error)
}
Expand Down

0 comments on commit 7e1b0b7

Please sign in to comment.