def inflate.stored.nlen
gralha-bytes@0.1.0.1 · bytes.bend:280
import gralha-bytes@0.1.0.1/bytes.bend as Bytes
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
280def inflate.stored.nlen(read: BitRead, +length: U32, +out: Bytes, limit: U32) -> Inflate:
281 BitRead{inverse, stream} = read
282 +input = stream
283 U.branch(Inflate, bits.valid(input) && U32.is_eq(U32.xor(length, inverse), 65535) && U32.is_le(length, (limit - bytes.size(out) : U32)),
284 _ => inflate.stored.copy(U32.to_nat(length), input, out), _ => Inflate{bits.invalid(input), out})