public static Chat FromChatString(string item) { if (item == null) { throw new ArgumentNullException("item"); } if (!item.StartsWith("Chat:")) { throw new ArgumentException("item"); } try { using (Stream stream = OutoposConverter.FromBase64String(item.Remove(0, "Chat:".Length))) { return(OutoposConverter.FromStream <Chat>(stream)); } } catch (Exception) { throw new FormatException(); } }