| 258 | } |
| 259 | |
| 260 | void BlCvStreamWriter::Write(const void* data, int size) |
| 261 | { |
| 262 | while (mCurBlockPos + size > mCurBlockEnd) |
| 263 | { |
| 264 | int writeBytes = (int)(mCurBlockEnd - mCurBlockPos); |
| 265 | if (writeBytes > 0) |
| 266 | { |
| 267 | memcpy(mCurBlockPos, data, writeBytes); |
| 268 | data = (uint8*)data + writeBytes; |
| 269 | size -= writeBytes; |
| 270 | } |
| 271 | |
| 272 | int newBlock = mMsf->Alloc(); |
| 273 | mCurStream->mBlocks.Add(newBlock); |
| 274 | mCurBlockPos = (uint8*)mMsf->mBlocks[newBlock]->mData; |
| 275 | mCurBlockEnd = mCurBlockPos + CV_BLOCK_SIZE; |
| 276 | } |
| 277 | |
| 278 | if (size > 0) |
| 279 | { |
| 280 | memcpy(mCurBlockPos, data, size); |
| 281 | mCurBlockPos += size; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | |
| 286 | void BlCvStreamWriter::Write(ChunkedDataBuffer& buffer) |
no test coverage detected