protected function readRecord()
    {

        $this->debugCommand('record_marker');
        $marker = $this->readShort();
        /**
         * @see enterprise/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryProtocol.java
         */

        // -2=no record
        if ($marker == -2) {
            // no record
            return false;
        }

        // -3=Only recordID
        if ($marker == -3) {
            // only recordID
            $this->debugCommand('record_clusterID');
            $clusterID = $this->readShort();
            $this->debugCommand('record_position');
            $recordPos = $this->readLong();
            return new OrientDBTypeLink($clusterID, $recordPos);
        }

        $record = new OrientDBRecord();
        $this->debugCommand('record_type');
        $record->type = $this->readByte();
        $this->debugCommand('record_clusterID');
        $record->clusterID = $this->readShort();
        $this->debugCommand('record_position');
        $record->recordPos = $this->readLong();
        $this->debugCommand('record_version');
        $record->version = $this->readInt();
        $this->debugCommand('record_content');
        $record->content = $this->readBytes();

        return $record;
    }