Buffer question
Ok this is a similar question to my previous thread that got 0 responses but maybe this will help everyone out. Here is what I have done:
Dim httpFile As HttpPostedFile = File1.PostedFile
Dim buffer As System.IO.BufferedStream
Dim byt(buffer.Length) As Byte
buffer = New System.IO.BufferedStream(httpFile.InputStream)
buffer.Read(byt, 0, buffer.Length)
buffer.Flush()
buffer.Close()
Now here is my thing, i convert byt to a string
Dim strImage as string =System.text.encoding.Default.GetChars(byt)
I am doing this because I am trying to parse an image out of a Raw HTTP Request, I have been able to do this and I saved the image data to a text file to make sure i was doing this correctly, but my image data keeps getting corrupt. I have narrowed it down to about a series of 10 bytes.
The data that I collect in the above code is the good data, i can turn around and send that byte array back to the browser and it will display the image so i wrote out my byte values for the above code and then my byte values for the code that i have saved in a text file and the error occurs where I have, essentially, a Non Breaking space. The above code tells me it is a byte value of 0 but when i convert the text file of characters to an array of bytes it is telling me that a non breaking space has a value of 32?
So I guess my question is 1 wtf is a byte value of 32 and is there anyway to search a byte array and replace certain values in my case 32 with 0?
"The one language all programmers understand is profanity."
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click  on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
|