(bytes: ByteArray, offset: number = 0, length: number = 0)
| 97 | } |
| 98 | |
| 99 | public readBytes(bytes: ByteArray, offset: number = 0, length: number = 0): void { |
| 100 | if (length == null) |
| 101 | length = bytes.length; |
| 102 | |
| 103 | bytes.ensureWriteableSpace(offset + length); |
| 104 | |
| 105 | const byteView: Int8Array = new Int8Array(bytes.arraybytes); |
| 106 | const localByteView: Int8Array = new Int8Array(this.arraybytes); |
| 107 | |
| 108 | byteView.set(localByteView.subarray(this.position, this.position + length), offset); |
| 109 | |
| 110 | this.position += length; |
| 111 | |
| 112 | if (length + offset > bytes.length) |
| 113 | bytes.length += (length + offset) - bytes.length; |
| 114 | } |
| 115 | |
| 116 | public writeUnsignedByte(b: number): void { |
| 117 | this.ensureWriteableSpace(1); |
no test coverage detected