parse static method

Implementation

static EncryptedExtensions parse(QuicBuffer buf) {
  final extTotalLen = buf.pullUint16();
  final end = buf.readOffset + extTotalLen;

  final exts = <TlsExtension>[];

  while (buf.readOffset < end) {
    final type = buf.pullUint16();
    final len = buf.pullUint16();
    final data = buf.pullBytes(len);
    exts.add(TlsExtension(type: type, length: len, data: data));
  }

  return EncryptedExtensions(extensions: exts);
}