>+ const int readSize = 4096; >+ Stream networkStream = OpenRead (address); >+ MemoryStream ms = new MemoryStream (); >+ BinaryWriter bw = new BinaryWriter (ms); >+ byte[] buf = new byte [readSize]; >+ int size = 0; >+ do { >+ size = networkStream.Read (buf, 0, readSize); >+ bw.Write (buf, 0, size); >+ } while (size == readSize); >+ networkStream.Close (); >+ return ms.GetBuffer ();
You don't need the BinaryWriter. You can write the byte [] directly to ms. -Gonzalo _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list