public override void SerializeToStream(IRequestContext requestContext, object request, Stream stream) { using (var writer = new StreamWriter(stream)) { TypeSerializer.SerializeToWriter(request, writer); } }
protected override MemoryStream Serialize() { var stream = new MemoryStream(); var streamWriter = new StreamWriter(stream); serializer.SerializeToWriter(base.TestObject, streamWriter); streamWriter.Flush(); return(stream); }
protected override MemoryStream Serialize() { var stream = new MemoryStream(); _streamWriter = new StreamWriter(stream); _serializer.SerializeToWriter(base.SampleDataSet.Data, _streamWriter); _streamWriter.Flush(); return(stream); }
/// <summary> /// /// </summary> public void Save() { Stream stream = File.Open(CONFIG_FILE_NAME, FileMode.Create); var writer = new TypeSerializer<SystemConfig>(); var streamWriter = new StreamWriter(stream); writer.SerializeToWriter(this, streamWriter); streamWriter.Close(); //var writer = new SoapFormatter(); //streamWriter.Flush(); /*stream.Flush(); stream.Close();*/ }