import java.io.*;

// UTF-8 (8-bit UCS/Unicode Transformation Format) is a
// variable-length character encoding for Unicode.

public class BinaryWrite {
    public static void main (String [] arg) throws IOException {

	OutputStream os = new FileOutputStream (arg[0]);
	
	DataOutputStream dos = new DataOutputStream (os);
	
	dos.writeByte(37);
	dos.writeShort(1234);
	dos.writeInt(123456);
	dos.writeLong(1234567891234567L);

	dos.writeBoolean(true);
	dos.writeChar('@');

	dos.writeFloat(3.14f);

	dos.writeDouble(1.41);

	dos.writeUTF("hejåäöÅÄÖhopp");
    }
}
