package io_bin;
/**
 * @author Fenyvesi Tibor
 */
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class io_bin {
    public static void main(String[] args) {
        try {
            FileOutputStream fstr = new FileOutputStream("binary.dat");
            for (int i = 65; i <= 90; i++) {
                fstr.write(i);
            }
            fstr.close();
        }
        catch (IOException ioe) {
            System.err.println(ioe.getMessage());
        }

        try {
            FileInputStream fis = new FileInputStream("binary.dat");
            int b;
            while ((b = fis.read()) != -1) {
                System.out.print((char)b + " ");
            }
            System.out.println();
            fis.close();
        }
        catch (IOException ioe) {
            System.err.println(ioe.getMessage());
        }
    }
}

