def hdr.read

bend-kit-tar@0.3.0.0 · tar.bend:365

import bend-kit-tar@0.3.0.0/tar.bend as Tar
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

365# Cursor.read establishes that all fixed offsets below belong to a complete block.
366def hdr.read(b: Bytes.Bytes, +i: U32) -> Bytes.Bytes & Maybe<&2, Hdr>:
367  Bytes.Bytes{+len, a} = b
368  hdr.sum(len, i, bsum(a, (i >> 2n : U32)))

Uses (8)

Used by (1)