import java.io.*; import java.util.*; public class Bin { public static void main (String args[]) throws java.io.IOException { String file, String1; boolean cont = true; file = "Bin.txt"; FileOutputStream write; Scanner text = new Scanner(System.in); write = new FileOutputStream (file); while (cont) { String1 = text.nextLine(); if (String1.length() == 0) { cont = false; } else { new PrintStream(write).println(String1); //C } } System.out.println("ENDED"); write.close(); //C text.close(); } }