public function readNextKeyValuePair( $truncatedString ) : ContainerElement {
        $keyBytes = $this->extractKeyBytes( $truncatedString );
        $remainingBytes = substr( $truncatedString, $keyBytes->getLength() );
        $data = $this->readData( $remainingBytes );
        return new ContainerElement($keyBytes, $data);
    }
public function readNextKeyValuePair( $truncatedString ) : ContainerElement {
        $keyBytes = $this->extractKeyBytes( $truncatedString );
        $remainingBytes = substr( $truncatedString, $keyBytes->getLength() );
        $data = $this->readData( $remainingBytes );
        return new ContainerElement($keyBytes, $data);
    }
public function readNextKeyValuePair ( $ truncatedString ) : ContainerElement { $ keyBytes = $ this -> extractKeyBytes ( $ truncatedString ) ; $ remainingBytes = substr ( $ truncatedString , $ keyBytes -> getLength ( ) ) ; $ data = $ this -> readData ( $ remainingBytes ) ; return new ContainerElement ( $ keyBytes , $ data ) ; }
This method receives a data string that is already truncated.
The expectation is that the first bytes will represent the key, then a series
of bytes will represent the value. That value will end either at the beginning of the
next data structure or the end of the data string.
@param type $truncatedString
This method receives a data string that is already truncated . The expectation is that the first bytes will represent the key then a series of bytes will represent the value . That value will end either at the beginning of the next data structure or the end of the data string .