Menu

#57 Stream as Attachment

open
None
5
2005-04-03
2005-02-28
Anonymous
No

Stream stream = streams[i]; // stream.Position != 0 !!!

SmtpAttachment attach = new SmtpAttachment
(stream, fileName); // pending

If stream.Position = stream.Length then infinite loop
while(rdlen < totlen)
{
len =
inputStream.Read(bin, 0, (int)inputStream.Length);

encStream.Write(bin, 0, len);

//inputBlock size(3)
rdlen =
(rdlen + ((len / transformer.InputBlockSize) *
transformer.OutputBlockSize));
}

Discussion

  • Ian Stallings

    Ian Stallings - 2005-04-03
    • assigned_to: nobody --> sheda0
     
  • GWSyZyGy

    GWSyZyGy - 2005-09-14

    Logged In: YES
    user_id=1068867

    stream.Position should be set to 0 before the loop. I ran into
    this the other day using a MemoryStream.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.