BinaryWriter.js 260 B

12345678910111213141516
  1. class BinaryWriter {
  2. constructor(stream) {
  3. this._stream = stream;
  4. }
  5. write(buffer) {
  6. this._stream = Buffer.concat([this._stream, buffer]);
  7. }
  8. getValue() {
  9. return this._stream;
  10. }
  11. }
  12. module.exports = BinaryWriter;