public static T FromJson(string json) { TMemoryBuffer trans = new TMemoryBuffer(Encoding.UTF8.GetBytes(json)); TProtocol prot = new TSimpleJSONProtocol(trans); return(Proto <T> .Read(prot)); }
public static T FromBytes(byte[] bytes) { TMemoryBuffer trans = new TMemoryBuffer(bytes); TProtocol prot = new TCompactProtocol(trans); return(Proto <T> .Read(prot)); }
public static T FromXml(string xml) { TMemoryBuffer trans = new TMemoryBuffer(Encoding.UTF8.GetBytes(xml)); TProtocol prot = new TXmlProtocol(trans); return(Proto <T> .Read(prot)); }
public static T FromJson(string json) { using (StringReader stringReader = new StringReader(json)) { JsonReader reader = new JsonTextReader(stringReader); reader.DateParseHandling = DateParseHandling.None; reader.Read(); return(Proto <T> .Read(reader)); } }
public static T FromXml(string xml) { XmlReaderSettings readerSettings = new XmlReaderSettings { IgnoreProcessingInstructions = true, IgnoreWhitespace = true, IgnoreComments = true, }; MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)); XmlReader reader = XmlReader.Create(stream, readerSettings); reader.Read(); return(Proto <T> .Read(reader)); }
public T Read(JsonReader reader) { return(Proto <T> .Read(reader)); }
public T Read(XmlReader reader) { return(Proto <T> .Read(reader)); }
public T Read(XElement xe) { return(Proto <T> .Read(xe)); }
public T Read(TProtocol iprot) { return(Proto <T> .Read(iprot)); }
public static T FromXDoc(XElement xe) { // XElement xe = XElement.Load(new StringReader(xml)); return(Proto <T> .Read(xe)); }
public static T Read(TProtocol iprot) { T value = new T(); return(Proto <T> .Read(iprot, value)); }