Changed operators << and >> to handle both file and network