write UUID to a File with FileOutputStream - Android File Input Output

Android examples for File Input Output:Binary File

Description

write UUID to a File with FileOutputStream

Demo Code


//package com.java2s;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import java.util.UUID;

public class Main {
    private static void writeInstallationFile(File installation)
            throws IOException {
        FileOutputStream out = new FileOutputStream(installation);
        String id = UUID.randomUUID().toString();
        out.write(id.getBytes());/*from   w  w  w. j a  v a  2 s . co m*/
        out.close();
    }
}

Related Tutorials