protected function _readRecord()
{
$classId = $this->_readShort();
$record = ['classId' => $classId];
if ($classId === -1) {
throw new SocketException('No class for record, cannot proceed!');
} elseif ($classId === -2) {
// null record
$record['bytes'] = null;
} elseif ($classId === -3) {
// reference
$record['type'] = 'd';
$cluster = $this->_readShort();
$position = $this->_readLong();
$record['rid'] = new ID($cluster, $position);
} else {
$record['type'] = $this->_readChar();
$cluster = $this->_readShort();
$position = $this->_readLong();
$record['version'] = $this->_readInt();
$data = CSV::unserialize($this->_readBytes());
$record['rid'] = new ID($cluster, $position);
if (isset($data['oClass'])) {
$record['oClass'] = $data['oClass'];
unset($data['oClass']);
}
$record['oData'] = $data;
}
return $record;
}