pub fn sub(d: *Decoder, their_len: usize) !Decoder d: *Decodertheir_len: usize746
747
748
749
750
751
752
753 pub fn sub(d: *Decoder, their_len: usize) !Decoder {
const end = d.idx + their_len;
if (end > d.their_end) return error.TlsDecodeError;
const sub_buf = d.buf[d.idx..end];
d.idx = end;
d.our_end = end;
return fromTheirSlice(sub_buf);
}
Provide the length they claim, and receive a sub-decoder specific to that slice. The parent decoder is advanced to the end.