Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import java.nio.file.*;
  2. import java.io.*;
  3. import static java.nio.file.StandardOpenOption.*;
  4.  
  5. public class BufferedOutputStreamSample {
  6. public static void main(String[] args)
  7. {
  8. Path file =
  9. Paths.get("C:\\Java\\Chapter8\\first_name.txt);
  10. Strring A = "FREINARD";
  11. OutputStream output = null;
  12. try
  13. {
  14. output = new
  15. BufferedOutputStream(Files.newOutputStream(file, CREATE));
  16. output.write(data);
  17. output.flush();
  18. output.close();
  19.  
  20. }
  21. catch(Exception e)
  22. {
  23. System.out.println("Message: " - e);
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement