Code example for PrintWriter

Methods: PrintWriter.println, close, println

0
     * attacker. 
     */ 
    private void addDeviceSpecificEntropy() { 
        PrintWriter out = null;
        try { 
            out = new PrintWriter(new FileOutputStream(RANDOM_DEV));
            out.println("Copyright (C) 2009 The Android Open Source Project");
            out.println("All Your Randomness Are Belong To Us");
            out.println(START_TIME);
            out.println(START_NANOTIME);
            out.println(SystemProperties.get("ro.serialno"));
            out.println(SystemProperties.get("ro.bootmode"));
            out.println(SystemProperties.get("ro.baseband"));
            out.println(SystemProperties.get("ro.carrier"));
            out.println(SystemProperties.get("ro.bootloader"));
            out.println(SystemProperties.get("ro.hardware"));
            out.println(SystemProperties.get("ro.revision"));
            out.println(System.currentTimeMillis());
            out.println(System.nanoTime());
        } catch (IOException e) {
            Log.w(TAG, "Unable to add device specific data to the entropy pool", e);
        } finally { 
            if (out != null) {
                out.close();
            } 
        } 
    } 
 
    private static String getSystemDir() {