Validate that offset is 4-byte aligned; throws ZR_MISALIGNED on violation.
(offset: number = this.off)
| 47 | |
| 48 | /** Validate that offset is 4-byte aligned; throws ZR_MISALIGNED on violation. */ |
| 49 | ensureAligned4(offset: number = this.off): void { |
| 50 | if ((offset & 3) !== 0) { |
| 51 | throw new ZrBinaryError({ |
| 52 | code: "ZR_MISALIGNED", |
| 53 | offset, |
| 54 | detail: "offset must be 4-byte aligned", |
| 55 | }); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /** Advance cursor by len bytes without reading; validates bounds first. */ |
| 60 | skip(len: number): void { |