UNPKG

gnablib

Version:

A lean, zero dependency library to provide a useful base for your project.

2 lines 300 B
/*! Copyright 2025 the gnablib contributors MPL-1.1 */ import{sInt as t}from"../safe/safe.js";export class AByteReader{constructor(t){this._buff=t,this._ptr=0}get unread(){return this._buff.length-this._ptr}skip(s){t("count",s).unsigned().atMost(this._buff.length-this._ptr).throwNot(),this._ptr+=s}}