Set the size of the attached file.

@param  integer|float $size A file size in bytes; the one of the attached.
@throws InvalidArgumentException If provided argument is not of type 'integer' or 'float'.
@return self
540314
public function setFileSize($size)
    {
        if ($size === null) {
            $this->fileSize = null;

            return $this;
        }

        if (!is_numeric($size)) {
            throw new InvalidArgumentException('File size must be an integer or a float.');
        }

        $this->fileSize = $size;

        return $this;
    }
913999
public function add(Size $size): Size
    {
        $this->bit = $this->bit + $size->get('b');
        return $this;
    }
602509
public function setFileFormat($format)
    {
        if (!in_array($format, array(self::FORMAT_BMP, self::FORMAT_TGA))) {
            throw new \InvalidArgumentException('Invalid file format: '.$format, ErrorCodes::INVALID_VALUE);
        }
        $this->setArgument('f', $format);
        return $this;
    }
1128695
def set_size(self, size):
        
        if not isinstance(size, baseinteger):
            raise TypeError("size can only be an instance of type baseinteger")
        self._call("setSize",
                     in_p=[size])
866768
public function setChunkSize($size)
    {
        if(static::MODE == 'cli' && is_numeric($size))
        {
            $this->chunkSize = (int)$size;
        }
        elseif(static::MODE == 'web')
        {
            throw new Exception('Chunk size is not supported on web mode');
        }
        else
        {
            throw new Exception("$size is not a valid chunk size");
        }

        return $this;
    }
836098
public function setSize(float $size) {
        if(!$this->setModified('size', $size)->isModified()) {
            return $this;
        }
		$this->size = $size;
		return $this;
    }
447374
public static function iniSizeToBytes($size)
    {
        if (\is_numeric($size)) {
            return (int)$size;
        }

        $suffix = \strtoupper(\substr($size, -1));
        $strippedSize = \substr($size, 0, -1);

        if (!\is_numeric($strippedSize)) {
            throw new \InvalidArgumentException("$size is not a valid ini size");
        }

        if ($strippedSize <= 0) {
            throw new \InvalidArgumentException("Expect $size to be higher isn't zero or lower");
        }

        if ($suffix === 'K') {
            return $strippedSize * 1024;
        }
        if ($suffix === 'M') {
            return $strippedSize * 1024 * 1024;
        }
        if ($suffix === 'G') {
            return $strippedSize * 1024 * 1024 * 1024;
        }
        if ($suffix === 'T') {
            return $strippedSize * 1024  * 1024 * 1024 * 1024;
        }

        return (int)$size;
    }
1095636
public function setCacheSize($size)
    {
        $this->cacheSize = $size;
        $this->logger->debug('LRUcache: set size: ' . $size );
        return true;
    }
1313560
private function setGlowSize($size)
    {
        if (!is_null($size)) {
            $this->glowProperties['size'] = $this->getExcelPointsWidth($size);
        }

        return $this;
    }
525669
public static function wrap($resource = '', $size = null)
    {
        if ($resource instanceof Stream) {
            return $resource;
        }

        $type = gettype($resource);

        if ($type == 'string') {
            return self::fromString($resource, $size);
        }

        if ($type == 'resource') {
            return new self($resource, $size);
        }

        throw new InvalidArgumentException('Invalid resource type: ' . $type);
    }
895223
private function setSize($size = null)
    {
        if ($size !== null) {
            $size = (int) $size;

            if ($size < 0) {
                throw new \RuntimeException('File size cannot be a negative value ! (size: ' . $size . ')');
            }
        }

        $this->size = $size;

        return $this;
    }
642600
public function setSize($size = null) {
        $this->_size = is_int($size)? $size : self::DEFAULT_SIZE;
    }
1210467
public function increase(int $size)
	{
		$count = $this->count();
		if ($size > $this->count()) {
			$add = $size - $this->count();
			$key = $this->storeKey();
			for ($i = 0; $i < $add; $i++) {
				$this->addEmpty();
			}
		}

		return $this;
	}
1324806
public static function filesizeToBytes($size)
    {
        $unit = preg_replace('/[^bkmgtpezy]/i', '', $size);
        $size = preg_replace('/[^0-9\.]/', '', $size);

        if ($unit) {
            return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
        }

        return round($size);
    }
813108
public function floatNone($size = null)
    {
        if (empty($size)) {
            $this->attributes->addAttributeClass('float-none');
        } elseif (in_array($size, ['xs', 'sm', 'md', 'lg', 'xl'])) {
            $this->attributes->addAttributeClass('float-' . $size . '-none');
        }

        return $this;
    }
1373668
public function setSize($size)
	{
		$this->size = $size;
		$this->pixelRatio = round($size / 5);

		return $this;
	}
1302524
public function setBlockSize($size)
    {
        if ($size <= 1) {
            throw new \InvalidArgumentException("Pixel Size Must Be Greater Than One");
        }
        $this->size = (int) abs($size);

        return $this;
    }