* Add fill to Stream

This commit is contained in:
2014-05-15 00:41:54 -07:00
parent a19520ea1e
commit dfb0ce0b4f
4 changed files with 17 additions and 1 deletions

View File

@@ -460,6 +460,17 @@ void BinaryWriter::writeString(const std::string& str)
writeUByte(0);
}
void BinaryWriter::fill(Uint8 val, Uint64 length)
{
while ((length--) > 0)
writeUByte(val);
}
void BinaryWriter::fill(Int8 val, Uint64 length)
{
fill((Uint8)val, length);
}
void BinaryWriter::setProgressCallback(std::function<void (int)> cb)
{
m_progressCallback = cb;