Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Escher.php
private function readBSE()
    {
        // offset: 0; size: 2; recVer and recInstance

        // bit: 4-15; mask: 0xFFF0; recInstance
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;

        $length = Xls::getInt4d($this->data, $this->pos + 4);
        $recordData = substr($this->data, $this->pos + 8, $length);

        // move stream pointer to next record
        $this->pos += 8 + $length;

        // add BSE to BstoreContainer
        $BSE = new BSE();
        $this->object->addBSE($BSE);

        $BSE->setBLIPType($recInstance);

        // offset: 0; size: 1; btWin32 (MSOBLIPTYPE)
        $btWin32 = ord($recordData[0]);

        // offset: 1; size: 1; btWin32 (MSOBLIPTYPE)
        $btMacOS = ord($recordData[1]);

        // offset: 2; size: 16; MD4 digest
        $rgbUid = substr($recordData, 2, 16);

        // offset: 18; size: 2; tag
        $tag = Xls::getUInt2d($recordData, 18);

        // offset: 20; size: 4; size of BLIP in bytes
        $size = Xls::getInt4d($recordData, 20);

        // offset: 24; size: 4; number of references to this BLIP
        $cRef = Xls::getInt4d($recordData, 24);

        // offset: 28; size: 4; MSOFO file offset
        $foDelay = Xls::getInt4d($recordData, 28);

        // offset: 32; size: 1; unused1
        $unused1 = ord($recordData[32]);

        // offset: 33; size: 1; size of nameData in bytes (including null terminator)
        $cbName = ord($recordData[33]);

        // offset: 34; size: 1; unused2
        $unused2 = ord($recordData[34]);

        // offset: 35; size: 1; unused3
        $unused3 = ord($recordData[35]);

        // offset: 36; size: $cbName; nameData
        $nameData = substr($recordData, 36, $cbName);

        // offset: 36 + $cbName, size: var; the BLIP data
        $blipData = substr($recordData, 36 + $cbName);

        // record is a container, read contents
        $reader = new self($BSE);
        $reader->load($blipData);
    }
private function readBSE()
    {
        // offset: 0; size: 2; recVer and recInstance

        // bit: 4-15; mask: 0xFFF0; recInstance
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;

        $length = Xls::getInt4d($this->data, $this->pos + 4);
        $recordData = substr($this->data, $this->pos + 8, $length);

        // move stream pointer to next record
        $this->pos += 8 + $length;

        // add BSE to BstoreContainer
        $BSE = new BSE();
        $this->object->addBSE($BSE);

        $BSE->setBLIPType($recInstance);

        // offset: 0; size: 1; btWin32 (MSOBLIPTYPE)
        $btWin32 = ord($recordData[0]);

        // offset: 1; size: 1; btWin32 (MSOBLIPTYPE)
        $btMacOS = ord($recordData[1]);

        // offset: 2; size: 16; MD4 digest
        $rgbUid = substr($recordData, 2, 16);

        // offset: 18; size: 2; tag
        $tag = Xls::getUInt2d($recordData, 18);

        // offset: 20; size: 4; size of BLIP in bytes
        $size = Xls::getInt4d($recordData, 20);

        // offset: 24; size: 4; number of references to this BLIP
        $cRef = Xls::getInt4d($recordData, 24);

        // offset: 28; size: 4; MSOFO file offset
        $foDelay = Xls::getInt4d($recordData, 28);

        // offset: 32; size: 1; unused1
        $unused1 = ord($recordData[32]);

        // offset: 33; size: 1; size of nameData in bytes (including null terminator)
        $cbName = ord($recordData[33]);

        // offset: 34; size: 1; unused2
        $unused2 = ord($recordData[34]);

        // offset: 35; size: 1; unused3
        $unused3 = ord($recordData[35]);

        // offset: 36; size: $cbName; nameData
        $nameData = substr($recordData, 36, $cbName);

        // offset: 36 + $cbName, size: var; the BLIP data
        $blipData = substr($recordData, 36 + $cbName);

        // record is a container, read contents
        $reader = new self($BSE);
        $reader->load($blipData);
    }
Read BSE record.