private LoginResult RecieveLoginResult(NetworkStream stream) { byte[] bytes = ReadData(sizeof(int), _networkStream); int size = BitConverter.ToInt32(bytes, 0); bytes = ReadData(size, _networkStream); LoginResult result = LoginResult.FromBytes(bytes); return(result); }