UtilJsonApiSerializer.Serialization.JsonApiFormatter.ReadFromStream C# (CSharp) Method

ReadFromStream() public method

public ReadFromStream ( Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger ) : object
type System.Type
readStream Stream
content System.Net.Http.HttpContent
formatterLogger IFormatterLogger
return object
        public override object ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
        {
            using (var reader = new StreamReader(readStream))
            using (var jsonReader = new JsonTextReader(reader))
            {
                var updateDocument = jsonSerializer.Deserialize(jsonReader, typeof (UpdateDocument)) as UpdateDocument;
                ValidateUpdateDocument(updateDocument);

                return new UpdateDocumentTypeWrapper(updateDocument, type);
            }
        }