what i mean is why starting explanation with bytes... we are humans we don't deal with bytes we don't understand them
Code: Select all
InputStream fis = new FileInputStream("C:\\Users\\batman\\Desktop\\ocp\\myfile.txt");
int bite = fis.read();
while (bite != -1) {
char letter = (char) bite;
System.out.print(letter);
bite = fis.read();
}
fis.close();
try (OutputStream fos = new FileOutputStream("C:\\Users\\batman\\Desktop\\ocp\\myfileout.txt")) {
String s = "hello world";
fos.write("hello world".getBytes());
}