Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class WriteBytes {
- public static void main(String args[]) {
- byte[] cities = { 'n', 'e', 'w', 'y', 'o', 'r', 'k', '\n', 'd', 'c' };
- try (
- FileOutputStream outfile = new FileOutputStream("newfile.txt");
- ) {
- outfile.write(cities);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement