FromStream() 공개 추상적인 메소드

Finds an IFormatter with a matching intent , and deserializes the Stream to an object graph.
public abstract FromStream ( Stream input, Type outputType, string intent = null ) : object
input Stream
outputType System.Type
intent string
리턴 object
예제 #1
0
        public static object FromJson(this AbstractSerializationService service, string json, Type outputType, string intent = null)
        {
            if (json.IsNullOrWhiteSpace())
            {
                return(outputType.GetDefaultValue());
            }
            var stream = new MemoryStream(Encoding.UTF8.GetBytes(json));

            return(service.FromStream(stream, outputType, intent));
        }