Advertisement
Guest User

Untitled

a guest
Mar 7th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. FileOutputStream writer = new FileOutputStream("output.txt");
  2. Scanner scanner = new Scanner(Test.class.getResourceAsStream("input.txt"));
  3. String line;
  4. while(scanner.hasNextLine()){
  5. line = scanner.nextLine();
  6. String[] split = line.split(" ");
  7. byte[] chars = new byte[split.length];
  8. for (int i = 0; i < split.length; i++)
  9. chars[i] = (byte) (int) Integer.valueOf(split[i]);
  10. writer.write(chars);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement