P
PCH
I'm trying to pull a data file that has an image (jpeg) embedded in it.
I can locate the bytes for the image, but when I try to write it to a file,
the image ends up being corrupt!
the kb/b size is the same as the original image, but the data itself isnt.
I have the binary data in a byte array and loop through it to write it out.
When i look at the data i can see the characters are different. Like the
conversion to char isnt the same as the original, etc.
Any ideas?
heres the code...
for (int i = 0; i < bytes.Length; i++)
{
//w.Write(bytes);
w.Write(System.Convert.ToChar(bytes));
}
w.Close();
fs.Close();
I can locate the bytes for the image, but when I try to write it to a file,
the image ends up being corrupt!
the kb/b size is the same as the original image, but the data itself isnt.
I have the binary data in a byte array and loop through it to write it out.
When i look at the data i can see the characters are different. Like the
conversion to char isnt the same as the original, etc.
Any ideas?
heres the code...
for (int i = 0; i < bytes.Length; i++)
{
//w.Write(bytes);
w.Write(System.Convert.ToChar(bytes));
}
w.Close();
fs.Close();