Answers for "java ariable types is used by fileinputstream and fileoutputstream to read and write to files?"

0

write files with FileOutPutStream java

@Test
public void givenWritingStringToFile_whenUsingFileOutputStream_thenCorrect() 
  throws IOException {
    String str = "Hello";
    FileOutputStream outputStream = new FileOutputStream(fileName);
    byte[] strToBytes = str.getBytes();
    outputStream.write(strToBytes);

    outputStream.close();
}
Posted by: Guest on November-28-2021

Code answers related to "java ariable types is used by fileinputstream and fileoutputstream to read and write to files?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language