return file from memory
BCS
ao at pathlink.com
Fri May 25 10:08:39 PDT 2007
Reply to Charma,
>> writefln(buff); // <-- up to here it seems to work perfectly
>> ...
>> MemoryStream Request = new MemoryStream;
>> Request.reserve(sizeOfRequestedFile);
>> Request.write(buff); // here i write it into the MemoryStream
>>
>> return Request;
>> }
[...]
> I'm very sorry... the stupid me forgot to seek to position 0 again
> before reading! Everything works perfect now! Thanks a lot!
>
option #2:
MemoryStream Request = new MemoryStream(buff);
// no seek(0) needed
More information about the Digitalmars-d
mailing list