Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gram-js/gramjs
Browse files Browse the repository at this point in the history
  • Loading branch information
painor committed Oct 4, 2023
2 parents e7f1524 + 468fd51 commit ccce7de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gramjs/extensions/BinaryWriter.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export class BinaryWriter {
private _stream: Buffer;
private readonly _buffers: Buffer[];

constructor(stream: Buffer) {
this._stream = stream;
this._buffers = [stream];
}

write(buffer: Buffer) {
this._stream = Buffer.concat([this._stream, buffer]);
this._buffers.push(buffer);
}

getValue() {
return this._stream;
getValue(): Buffer {
return Buffer.concat(this._buffers);
}
}

0 comments on commit ccce7de

Please sign in to comment.