$this->initBackBuffer();
// Separate data
- $dataArray = explode($this->getBlockInstance()->getBlockSeparator(), $data);
+ $dataArray = explode(self::getBlockSeparator(), $data);
// Left part is the actual block, right one the back-buffer data
$this->setCurrentBlock($dataArray[0]);
// If some bytes could be read, all is fine
$isValid = ((is_string($data)) && (strlen($data) > 0));
- // Seek back to old position
- $this->seek($seekPosition);
+ // Get header size
+ $headerSize = $this->getBlockInstance()->getHeaderSize();
+
+ // Is the seek position at or beyond the header?
+ if ($seekPosition >= $headerSize) {
+ // Seek back to old position
+ $this->seek($seekPosition);
+ } else {
+ // Seek directly behind the header
+ $this->seek($headerSize);
+ }
// Return result
return $isValid;