public addContent ( string $content ) | ||
$content | string | binary content. |
public function addContent($content)
{
$freeBufferLength = $this->chunkSize - StringHelper::byteLength($this->buffer);
$contentLength = StringHelper::byteLength($content);
if ($contentLength > $freeBufferLength) {
$this->buffer .= StringHelper::byteSubstr($content, 0, $freeBufferLength);
$this->flushBuffer(true);
return $this->addContent(StringHelper::byteSubstr($content, $freeBufferLength));
} else {
$this->buffer .= $content;
$this->flushBuffer();
}
return $this;
}