]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/index/file_stack/class_FileStackIndex.php
Continued:
[core.git] / framework / main / classes / index / file_stack / class_FileStackIndex.php
index 0a10498440c538694aac313349475e5b9cd407b0..218b9b74f4e8e8d44fdd9b9b8913ed211a747555 100644 (file)
@@ -10,6 +10,7 @@ use Org\Mxchange\CoreFramework\Stacker\Filesystem\BaseFileStack;
 use Org\Mxchange\CoreFramework\Stacker\Index\IndexableStack;
 
 // Import SPL stuff
+use \InvalidArgumentException;
 use \SplFileInfo;
 
 /**
@@ -107,9 +108,16 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable {
         *
         * @param       $length                 Length of raw data
         * @return      $seekPosition   Found next gap's seek position
+        * @throws      InvalidArgumentException        If the parameter is not valid
+        * @todo        Unfinished work
         */
        public function searchNextGap (int $length) {
-               $this->partialStub('length=' . $length);
+               // Validate parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: length=%d - CALLED!', $length));
+               if ($length <= 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length));
+               }
        }
 
 }