def bytes.fits
import bend-kit-websocket@0.4.0.0/websocket.bend as Websocketimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
537# hs + len octets fit in end - pos exactly when this holds (Bytes law fits_exact); see law cut_exact.
538def bytes.fits(c: Bytes.Cursor, +hs: U32, +len: U32) -> Bytes.Cursor & Bool:
539 Bytes.Cursor{b, +pos, +start, +end} = c
540 (Bytes.Cursor{b, pos, start, end}, Bytes.fits((end - pos : U32), hs, len))