本文整理汇总了C++中TMemoryStream::ReadUInt方法的典型用法代码示例。如果您正苦于以下问题:C++ TMemoryStream::ReadUInt方法的具体用法?C++ TMemoryStream::ReadUInt怎么用?C++ TMemoryStream::ReadUInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMemoryStream
的用法示例。
在下文中一共展示了TMemoryStream::ReadUInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tmpOffset
bool z3ResEx::fsRle( TMemoryStream &src, TMemoryStream &dst, bool isMSF )
{
unsigned int msfSizeFlag;
unsigned int expectedSize, len;
unsigned char *pData( src.Data() ), *pDataEnd( pData + src.Size() );
if( isMSF )
{
// Read the expected size from data
msfSizeFlag = src.ReadUInt();
pData += 4;
}
if( !( z3Rle::decodeSize( pData, expectedSize, len ) ) )
{
dst.Close();
//printf("ERROR: Problems decoding RLE buffer size\n");
return false;
}
if( isMSF && !( msfSizeFlag == expectedSize ) )
{
dst.Close();
//printf("ERROR: Unexpected MSF buffer size\n");
return false;
}
// Skip the length of the expected size
pData += len;
unsigned char *tmpBuffer( new unsigned char[ expectedSize ] );
unsigned int tmpOffset( 0 );
while( tmpOffset < expectedSize )
{
if( !( z3Rle::decodeInstruction( pData, len, pDataEnd, tmpBuffer, tmpOffset ) ) )
{
delete tmpBuffer;
//printf("ERROR: Problems decoding RLE buffer\n");
return false;
}
pData += len;
}
dst.Write( tmpBuffer, expectedSize );
delete tmpBuffer;
return true;
}