protected function getPartitionCount()
{
// read topic count
$data = $this->stream->read(4, true);
$data = Decoder::unpack(Decoder::BIT_B32, $data);
$count = array_shift($data);
if ($count <= 0) {
throw new \Kafka\Exception\OutOfRange($count . ' is not a valid partition count');
}
return $count;
}