def process(self, buff):
<EOL>self.memory = self.memory + buff <EOL>self._available = len(self.memory)<EOL>idx = <NUM_LIT:0><EOL>handleheader = self.handle_read_header<EOL>handlelength = self.handle_read_length<EOL>handlevalue = self.handle_read_value<EOL>handleegend = self.handle_segment_ended<EOL>while self._available >= self._advance:<EOL><INDENT>if self._scstate.value <= ScannerState.WAITING_FOR_HEADER.value:<EOL><INDENT>self._advance = <NUM_LIT:1><EOL>handleheader(self.memory[idx])<EOL><DEDENT>elif self._scstate is ScannerState.WAITING_FOR_LENGTH:<EOL><INDENT>self._advance = self._state[<NUM_LIT:3>]<EOL>if self._available < self._state[<NUM_LIT:3>]:<EOL><INDENT>break<EOL><DEDENT>handlelength(self.memory, idx, idx + self._advance)<EOL><DEDENT>elif self._scstate is ScannerState.WAITING_FOR_VALUE:<EOL><INDENT>self._advance = self._state[<NUM_LIT:3>]<EOL>if self._available < self._advance:<EOL><INDENT>break<EOL><DEDENT>handlevalue(self.memory, idx, idx + self._advance)<EOL><DEDENT>elif self._scstate is ScannerState.WAITING_FOR_EXT_TYPE:<EOL><INDENT>self._advance = <NUM_LIT:1><EOL>self.handle_read_ext_type(self.memory, idx)<EOL><DEDENT>if self._scstate is ScannerState.SEGMENT_ENDED:<EOL><INDENT>handleegend()<EOL><DEDENT>self._available -= self._advance   <EOL>idx = idx + self._advance<EOL>self._advance = <NUM_LIT:1><EOL><DEDENT>self.memory = buffer(self.memory, idx, len(self.memory))<EOL>
Process the input buffer. The buffer can contains all or a segment of the bytes from the complete message. 
    The function will buffer what will require extra bytes to be processed. 
:param buff: