Code example for AtomicReference

0
    TextView tv;
    Handler uiHandler;
	 
    BlockingQueue<Parcel> toChild = new LinkedBlockingQueue<Parcel>();
    AtomicReference<Process> goProcess = new AtomicReference<Process>();
    AtomicReference<OutputStream> toChildRef = new AtomicReference<OutputStream>();
    private String TAG = "AnpherActivity";
	 
    private String binaryPath(String suffix) {
        return getBaseContext().getFilesDir().getAbsolutePath() + "/" + suffix;
    } 
 
    private void copyBinary() { 
        String src = "anpher";
        maybeCopyFile(src, "anphergo");
    } 
	 
    private void maybeCopyFile(String src, String dstSuffix) {
        String fullPath = binaryPath(dstSuffix);
        if (new File(fullPath).exists()) {
            Log.d(TAG, "file " + fullPath + " already exists");