Get/set the chunk size.

@param  integer     $chunkSize The chunk size.
@return string|self
173746
public function chunkSize($chunkSize = null)
    {
        if (!func_num_args()) {
            return $this->_chunkSize;
        }
        $this->_chunkSize = (int) $chunkSize;
        return $this;
    }
1336965
protected function readLine($handle, $chunkSize)
    {
        $line = $chunkSize ? fgets($handle, $chunkSize) : fgets($handle);

        return rtrim($line, "\n\r");
    }
882851
public function chunk($size, $preserveKeys = false): self
    {
        return static::create(
            \array_chunk($this->getArray(), $size, $preserveKeys),
            $this->iteratorClass,
            false
        );
    }
85396
public function setSize($size) {
		$this->owner->ButtonSize = trim(strtolower($size));
		return $this->owner;
	}
42699
public function splitFile($dstDir, $chunkSize = 2048)
    {
        $dstDir = rtrim($dstDir, DIRECTORY_SEPARATOR);

        $srcFile = fopen($this->filePath, 'r');
        $totalSize = filesize($this->filePath);
        $chunksNo = ceil($totalSize / $chunkSize);
        $lastChunkSize = $totalSize % $chunkSize;

        // Chunk must be the same size as requested but the last chunk can be up to $chunkSize * 2
        if ($lastChunkSize > 0 && $lastChunkSize < $chunkSize) {
            $chunksNo -= 1;
        }

        $chunkNames = [];
        $uniqueChunkName = uniqid();

        for ($x = 1; $x <= $chunksNo; ++$x) {
            // For the last chunk we send all bytes left
            if ($x == $chunksNo) {
                $chunkSize = -1;
            }

            $chunkName = $uniqueChunkName.'_'.$x;
            $chunkNames[] = $chunkName;

            $dstFilePath = $dstDir.DIRECTORY_SEPARATOR.$chunkName;
            $dstFile = fopen($dstFilePath, 'wb');

            stream_copy_to_stream($srcFile, $dstFile, $chunkSize);
            fclose($dstFile);
        }

        fclose($srcFile);

        return $chunkNames;
    }
1042470
public function getBatch($size = 10)
    {
        return $this->getConnection()->transactional(function () use ($size) {
            $emails = $this->find()
                ->where([
                    $this->aliasField('sent') => false,
                    $this->aliasField('send_tries') . ' <=' => 3,
                    $this->aliasField('send_at') . ' <=' => new FrozenTime('now'),
                    $this->aliasField('locked') => false,
                ])
                ->limit($size)
                ->order([$this->aliasField('created') => 'ASC']);

            $emails
                ->extract('id')
                ->through(function (\Cake\Collection\CollectionInterface $ids) {
                    if (!$ids->isEmpty()) {
                        $this->updateAll(['locked' => true], ['id IN' => $ids->toList()]);
                    }

                    return $ids;
                });

            return $emails->toList();
        });
    }
1306744
public function setSize($size) {
		if (is_int($size)) {
			return $this->addToProperty("class", CssRef::sizes("btn-group")[$size]);
		}
		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("btn-group"));
	}
1080979
public function split($chunkSize = 1)
    {
        if (!$this->isNumber($chunkSize)) {
            throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [
                '$chunkSize',
                'integer'
            ]);
        }

        $arr = str_split($this->val(), $chunkSize);

        return new ArrayObject($arr);
    }
637721
public function chunk($size, $preserveKeys = null)
    {
        return $this->bindNewInstance(
            array_map([$this, 'bindNewInstance'], array_chunk($this->convertArray($this), $size, $preserveKeys))
        );
    }
258224
protected function packSize($size)
    {
        return ($size <= 127)
            ? $this->pack(self::BINN_UINT8, $size)
            : $this->getInt32Binsize($size);
    }
614386
public function getSize() : ?string 
    {
        if ( ! $this->hasSize()) {
            $this->setSize($this->getDefaultSize());
        }
        return $this->size;
    }
863038
protected function readNext($handle, $chunkSize)
    {

        if (feof($handle)) {
            return null;
        }

        return $this->readFromHandle($handle, $chunkSize);
    }
526594
def is_valid_chunksize(chunk_size):
        """"""
        min_csize = current_app.config['FILES_REST_MULTIPART_CHUNKSIZE_MIN']
        max_csize = current_app.config['FILES_REST_MULTIPART_CHUNKSIZE_MAX']
        return chunk_size >= min_csize and chunk_size <= max_csize
609885
public function setSize($size = 32)
    {
        $size = (int)$size;

        // Gravatars can be sized 1px up to 2048px square: https://en.gravatar.com/site/implement/images/#size
        if ($size < 1) {
            $size = 1;
        }

        if ($size > 2048) {
            $size = 2048;
        }

        $this->size = $size;

        return $this;
    }
697459
public static function formatFileSize($size) {
        if ( $size/1024 < 1 ) {
            return $size ." B";
        } else if ( $size/1024 > 1 && $size/(1024*1024) < 1 ) {
            return number_format($size/1024, 2, '.', '') .'KB';
        } else if ( $size/(1024*1024) > 1 && $size/(1024*1024*1024)< 1 ) {
            return number_format($size/(1024*1024), 2, '.', '') ." MB";
        } else {
            return number_format($size/(1024*1024*1024), 2, '.', '')." GB";
        }
    }
1355803
public MediaHttpDownloader setChunkSize(int chunkSize) {
    Preconditions.checkArgument(chunkSize > 0 && chunkSize <= MAXIMUM_CHUNK_SIZE);
    this.chunkSize = chunkSize;
    return this;
  }
266738
public function getSize() : ?int 
    {
        if ( ! $this->hasSize()) {
            $this->setSize($this->getDefaultSize());
        }
        return $this->size;
    }