parse static method

GoawayCapsule parse(
  1. Uint8List bytes
)

Parse from bytes, skipping the leading type varint.

Implementation

static GoawayCapsule parse(Uint8List bytes) {
  final typeLen = VarInt.decodeLength(bytes[0]);
  if (bytes.length == typeLen) {
    return GoawayCapsule();
  }
  final streamId = VarInt.decode(
    bytes.buffer,
    offset: bytes.offsetInBytes + typeLen,
  );
  return GoawayCapsule(streamId: streamId);
}