strlen($data),
$data,
$this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (empty(trim($data, chr(0)))) {
// Empty header, file is freshly pre-allocated
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Empty file header detected - EXIT!');
throw new UnexpectedValueException(sprintf('data=%s does not have separator=0x%s at the end.',
$data,
dechex(BinaryFile::SEPARATOR_HEADER_ENTRIES)
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Okay, then remove it
$data,
count($header),
BinaryFile::HEADER_STACK_ELEMENT_COUNT
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($header[BinaryFile::HEADER_NAME_MAGIC] != StackableFile::STACK_MAGIC) {
// Bad magic
throw new InvalidMagicException($data, self::EXCEPTION_BAD_MAGIC);
strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]),
$header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES],
BinaryFile::LENGTH_COUNT
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (strlen($header[BinaryFile::HEADER_NAME_SEEK_POSITION]) != BinaryFile::LENGTH_POSITION) {
// Position length not valid
throw new UnexpectedValueException(sprintf('header[%s](%d)=%s is not expected %d length',
strlen($header[BinaryFile::HEADER_NAME_SEEK_POSITION]),
$header[BinaryFile::HEADER_NAME_SEEK_POSITION],
BinaryFile::LENGTH_POSITION
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Decode count and seek position
gettype($gapPosition),
$gapPosition,
$this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Then write the data at that gap