Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.nio.file.*;
- import java.io.*;
- import static java.nio.file.StandardOpenOption.*;
- public class BufferedOutputStreamSample {
- public static void main(String[] args)
- {
- Path file =
- Paths.get("C:\\Java\\Chapter8\\first_name.txt);
- Strring A = "FREINARD";
- OutputStream output = null;
- try
- {
- output = new
- BufferedOutputStream(Files.newOutputStream(file, CREATE));
- output.write(data);
- output.flush();
- output.close();
- }
- catch(Exception e)
- {
- System.out.println("Message: " - e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement