I'm passing some Base64 encoded strings through WCF, and I'm attempting to write them to a file. However, despite the fact that my FileStream object has a Length greater than 0, my file on disk remains empty.
FileStream fs = new FileStream(Config.Instance.SharedSettings.SaveDir + StudyInstance.StudyId + "\\tmp.ext", FileMode.Create);
EncodeBlock eb = new EncodeBlock();
while (eb.Part != eb.OfParts || eb.OfParts == 0)
{
eb.ToDecode = ps.StudyService.GetInstancePart(StudyInstance, s, eb.Part+ 1, Config.Instance.ClientSettings.AppData);
eb = Base64Encoder.Decode(eb);
fs.Write(eb.ToEncode, 0, eb.ToEncode.Length);
}
fs.Close();
eb.ToEncode
's length is always greater than 0, fs.Length
is always greater than 0, and yet my "tmp.ext"
file is created, but remains empty. fs.CanWrite
is always also true.