C# bitmap images, byte arrays and streams!

后端 未结 5 667
醉梦人生
醉梦人生 2021-01-25 17:12

I have a function which extracts a file into a byte array (data).

        int contentLength = postedFile.ContentLength;
        byte[] data = new byte[contentLen         


        
5条回答
  •  面向向阳花
    2021-01-25 17:28

    Have you checked the return value from the Read() call to verify that is actually reading all of the content? Perhaps Read() is only returning a portion of the stream, requiring you to loop the Read() call until all of the bytes are consumed.

提交回复
热议问题