*/
const LENGTH_TYPE = 20;
+ //***** Array elements for 'gaps' array *****
+
+ /**
+ * Start of gap
+ */
+ const GAPS_INDEX_START = 'start';
+
+ /**
+ * End of gap
+ */
+ const GAPS_INDEX_END = 'end';
+
/**
* Length of output from hash()
*/
*
* @return void
*/
- protected function rewineUpdateSeekPosition () {
+ protected function rewindUpdateSeekPosition () {
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
// flushFileHeader must be callable
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
}
+ /**
+ * Marks the currently loaded block as empty (with length of the block)
+ *
+ * @param $length Length of the block
+ * @return void
+ */
+ protected function markCurrentBlockAsEmpty ($length) {
+ // Get current seek position
+ $currentPosition = $this->key();
+
+ // Now add it as gap entry
+ array_push($this->gaps, array(
+ self::GAPS_INDEX_START => ($currentPosition - $length),
+ self::GAPS_INDEX_END => $currentPosition,
+ ));
+ }
+
/**
* Checks whether the file header is initialized
*
$this->flushFileHeader();
// Rewind seek position (to beginning of file) and update/flush file header
- $this->rewineUpdateSeekPosition();
+ $this->rewindUpdateSeekPosition();
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__));
}
$this->writeData($seekPosition, chr(0));
// Rewind seek position (to beginning of file) and update/flush file header
- $this->rewineUpdateSeekPosition();
+ $this->rewindUpdateSeekPosition();
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
}