[Mono-list] MemoryStream problem

Elan Feingold efeingold@mn.rr.com
Sun, 23 Feb 2003 18:18:07 -0600

> It may (or may not) be a MemoryStream issue. The current CryptoStream
> implementation is very rudimentary - it was able to run some samples
from MS
> but it's still far from complete. It's also one of the few crypto
class that
> still doesn't have any unit tests.

I just thought it was extremely odd that the new byte[capacity] would
fail when it was requesting less than 4Kb. It didn't seem like it
necessarily had anything to do with the CryptoStream stuff.

Do you know under what circumstances the "new byte[...]" can fail, and
where I could be looking for the problem?

Best regards,


> > The code for MemoryStream.ToArray() starts with:
> >
> > public virtual byte[] ToArray() {
> >                         byte[] outBuffer = new byte[capacity];
> >
> > What's happening is that outBuffer is coming back null! I'm only
> > requesting 3864 bytes, so I find that extremely odd.