public override Stream GetStreamAdapter(IValueManager AManager, Stream AStream) { using (StreamReader LReader = new StreamReader(AStream)) { string LValue = LReader.ReadToEnd(); Streams.IConveyor LConveyor = AManager.GetConveyor(ScalarType); MemoryStream LStream = new MemoryStream(LConveyor.GetSize(LValue)); LStream.SetLength(LStream.GetBuffer().Length); LConveyor.Write(LValue, LStream.GetBuffer(), 0); return LStream; } }
public override Stream GetStreamAdapter(IValueManager manager, Stream stream) { using (var reader = new StreamReader(stream)) { string tempValue = reader.ReadToEnd(); if (tempValue == " ") { tempValue = String.Empty; } IConveyor conveyor = manager.GetConveyor(ScalarType); var localStream = new MemoryStream(conveyor.GetSize(tempValue)); localStream.SetLength(localStream.GetBuffer().Length); conveyor.Write(tempValue, localStream.GetBuffer(), 0); return(localStream); } }