public static Request FromBinaryString(string BinaryRequestString) { string[] RequestParts = BinaryRequestString.Split(new char[] { ':' }, 2, StringSplitOptions.RemoveEmptyEntries); if (RequestParts.Length == 1) { return(Request.FromString(Tools.Base64Decode(RequestParts[0]))); } else if (RequestParts.Length == 2) { return(new Request(Tools.Base64Decode(RequestParts[0]), Tools.Base64DecodeToByteArray(RequestParts[1]))); } else { throw new Exception("Invalid input string"); } }