At this point most people will be thinking \"Ah ill post this..:\"
byte[] dataB= System.Text.Encoding.ASCII.GetBytes(data);
However.. the p
However.. the problem I have is i need the exact value of the bytes with no encoding just the pure value for each byte.
Then use this:
byte[] dataB = System.Text.Encoding.Unicode.GetBytes(data);
It returns the bytes as stored internally by .NET strings.
But all this is codswallop: A string is always linked to a particular encoding and there's no way around it. The above will fail e.g. if the file contains invalid Unicode code sequences (which may happen) or through normalization. Since you obviously don't want a string, don't read one. Read the file as binary data instead.