Okay so let's say I read a file and obtain all its bytes, byte[].
byte[] fileBytes = whatever;
(Let's pretend whatever is me reading the bytes)
Now let's say I made a string out of it with the OS's default charset,
String s = new String(fileBytes, Charset.defaultCharset());
In my case the OS's default charset is windows-1252.
Right now because we read the file through the default charset, s.getBytes() is different from fileBytes.
How could we reverse the String s knowing the default charset back into the original fileBytes?
I appreciate all help, thanks! :)