summaryrefslogtreecommitdiffstats
path: root/comm/third_party/asn1js/src/ViewWriter.ts
blob: 1df3a1170c3583862e8a82875243cd358121fe8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as utils from "./internals/utils";

export class ViewWriter {

  public items: ArrayBuffer[] = [];

  /**
   * Writes buffer
   * @param buf
   */
  public write(buf: ArrayBuffer): void {
    this.items.push(buf);
  }

  /**
   * Concatenates all buffers
   * @returns Concatenated buffer
   */
  public final(): ArrayBuffer {
    return utils.concat(this.items);
  }
}