stringstream

 CIArchiveText::CIArchiveText(std::ifstream& instream)
{
	// Get the file size
	std::streamsize size;
	instream.seekg( 0, std::ios::end );
	size = instream.tellg();
	instream.seekg( 0, std::ios::beg );
	
	char buf[255];
	int remain = size;
	int block;
	while( remain > 0 )
	{
		block = (remain <= 255 ? remain : 255);
		// read buffer from file
		instream.read( buf, block );
		// write buffer to m_stream
		m_stream.write( buf, block );
		remain -= block;
	}
}
posted @ 2010-08-19 21:28  风生竹韵  阅读(164)  评论(0)    收藏  举报