private function insertChunk($data)
{
if ($this->isClosed) {
// TODO: Should this be an error condition? e.g. BadMethodCallException
return;
}
$toUpload = ['files_id' => $this->file['_id'], 'n' => $this->chunkOffset, 'data' => new Binary($data, Binary::TYPE_GENERIC)];
hash_update($this->ctx, $data);
$this->collectionWrapper->insertChunk($toUpload);
$this->length += strlen($data);
$this->chunkOffset++;
}