/** * read first block to skip the header */ protected function skipHeader() { parent::stream_read($this->headerSize); }
/** * read block to file */ protected function readCache() { // cache should always be empty string when this function is called // don't try to fill the cache when trying to write at the end of the unencrypted file when it coincides with new block if ($this->cache === '' && !($this->position === $this->unencryptedSize && $this->position % $this->unencryptedBlockSize === 0)) { // Get the data from the file handle $data = parent::stream_read($this->util->getBlockSize()); $this->cache = $this->encryptionModule->decrypt($data); } }