src/MySQLReplication/BinaryDataReader/BinaryDataReader.php
public function readCodedBinary()
    {
        $c = ord($this->read(self::UNSIGNED_CHAR_LENGTH));
        if ($c === self::NULL_COLUMN) {
            return '';
        }
        if ($c < self::UNSIGNED_CHAR_COLUMN) {
            return $c;
        }
        if ($c === self::UNSIGNED_SHORT_COLUMN) {
            return $this->readUInt16();
        }
        if ($c === self::UNSIGNED_INT24_COLUMN) {
            return $this->readUInt24();
        }
        if ($c === self::UNSIGNED_INT64_COLUMN) {
            return $this->readUInt64();
        }

        throw new BinaryDataReaderException('Column num ' . $c . ' not handled');
    }
public function readCodedBinary()
    {
        $c = ord($this->read(self::UNSIGNED_CHAR_LENGTH));
        if ($c === self::NULL_COLUMN) {
            return '';
        }
        if ($c < self::UNSIGNED_CHAR_COLUMN) {
            return $c;
        }
        if ($c === self::UNSIGNED_SHORT_COLUMN) {
            return $this->readUInt16();
        }
        if ($c === self::UNSIGNED_INT24_COLUMN) {
            return $this->readUInt24();
        }
        if ($c === self::UNSIGNED_INT64_COLUMN) {
            return $this->readUInt64();
        }

        throw new BinaryDataReaderException('Column num ' . $c . ' not handled');
    }
public function readCodedBinary ( ) { $ c = ord ( $ this -> read ( self :: UNSIGNED_CHAR_LENGTH ) ) ; if ( $ c === self :: NULL_COLUMN ) { return '' ; } if ( $ c < self :: UNSIGNED_CHAR_COLUMN ) { return $ c ; } if ( $ c === self :: UNSIGNED_SHORT_COLUMN ) { return $ this -> readUInt16 ( ) ; } if ( $ c === self :: UNSIGNED_INT24_COLUMN ) { return $ this -> readUInt24 ( ) ; } if ( $ c === self :: UNSIGNED_INT64_COLUMN ) { return $ this -> readUInt64 ( ) ; } throw new BinaryDataReaderException ( 'Column num ' . $ c . ' not handled' ) ; }
Read a 'Length Coded Binary' number from the data buffer.
Length coded numbers can be anywhere from 1 to 9 bytes depending
on the value of the first byte.
From PyMYSQL source code
@return int|string
@throws BinaryDataReaderException
Read a Length Coded Binary number from the data buffer . Length coded numbers can be anywhere from 1 to 9 bytes depending on the value of the first byte . From PyMYSQL source code