according to the task description volume has uint32 type. 
out.write( reinterpret_cast< char* > ( &volume_ ), sizeof( boost::uint32_t ) );