I am trying to convert a byte array to a string, all i need is to simply convert the number in byteArray to string Foreg. "12459865..."
I am trying to do this with this:
fileInString = Encoding.UTF8.GetString(fileInBytes, 0, fileInBytes.Length);
fileInBytes looks like this: 1212549878563212450045....
But resultant fileInString looks like this ID3\0\0\0\0JTENC\0\0\0@\0\0WXXX\0... and alot of weird characters.
I tried different Encoding styles including default but all insert some weird characters into it.
The only option I have is to loop and cast each member into the string
while (currbyte != -1)
{
currbyte = fileStream.ReadByte();
//fileInBytes[i++] = (byte)currbyte;
fileInString += currbyte.ToString();
progressBar1.Value = i++;
}
But this is TOO slow. Please tell me how can I convert by byte array into string using Encoding.....GetString
1212549878563212450045? could you separate it to each byte? such as 12|12|54|98 ... or 1|2||1|2|5|4|9|8...?fileInBytesarray its basically one like herefileInBytes[i++] = (byte)currbyte;progressBar1.Value = i++;, any UI updating related code will slow everything down, you should update the progressbar in a larger interval of time to reduce this or even in some case we don't even need any exact info on the current process, just some working notification is enough.