def METHOD_NAME(self, raw: bytes) -> bytes:
    cur = 0
    self.parse_fin_and_rsv(raw[cur])
    cur += 1
    self.parse_mask_and_payload(raw[cur])
    cur += 1
    if self.payload_length == 126:
        data = raw[cur: cur + 2]
        self.payload_length, = struct.unpack('!H', data)
        cur += 2
    elif self.payload_length == 127:
        data = raw[cur: cur + 8]
        self.payload_length, = struct.unpack('!Q', data)
        cur += 8
    if self.masked:
        self.mask = raw[cur: cur + 4]
        cur += 4
    assert self.payload_length
    self.data = raw[cur: cur + self.payload_length]
    cur += self.payload_length
    if self.masked:
        assert self.mask is not None
        self.data = self.apply_mask(self.data, self.mask)
    return raw[cur:]