Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 68x 68x 1507x 3205x 856x 2382x 842x 842x 1507x | import { hexToBytes } from '../encoding-hex';
import { concatByteArrays } from '../index';
 
export class BufferArray {
  _value: Uint8Array[] = [];
  get value() {
    return this._value;
  }
 
  appendHexString(hexString: string) {
    this.value.push(hexToBytes(hexString));
  }
 
  push(buffer: Uint8Array) {
    return this._value.push(buffer);
  }
 
  appendByte(octet: number) {
    Iif (!Number.isInteger(octet) || octet < 0 || octet > 255) {
      throw new Error(`Value ${octet} is not a valid byte`);
    }
    this.value.push(Uint8Array.from([octet]));
  }
 
  concatBuffer(): Uint8Array {
    return concatByteArrays(this.value);
  }
}
  |