you can write simplier:
in.read( reinterper_cast< char* >( variable ), sizeof( variable_type ) );