Professional Documents
Culture Documents
Streams Study
Streams Study
//writing into a file from the IDE itself using an array of bytes bcs it's
FileOutputStream not FileWriter
String test="gjkjgfjddhhhgdfgsys hstrsb shgshbg ";
byte content[]=test.getBytes();
FileOutputStream temp=new FileOutputStream(infile);
temp.write(content);
temp.close();
} catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}
}