I decided to do a test for how many different characters I could write. I tried this code:
for (int i = 0;i < 255;i++) {
myBufferedWriter.write(i);
}
But in the file, using my hex editor, I saw it counted normally at first 01, 02, 03...
, but then it got to 3F
, and wrote that around 20 times, and then continued writing normally. Can I not write certain characters? I want to be able to write all characters 0-255.
Full code:
public class Main {
public static void main(String[] args) {
try{
BufferedWriter bw = new BufferedWriter(new FileWriter(new File("abc.txt")));
for (int i = 0;i < 255;i++) {
bw.write(i);
}
bw.close();
}catch(Exception e){}
}
}