Code example for FileOutputStream

Methods: close, flush

0
            if (filename == null) return;
            final File file = new File(mCacheDir, filename);
            FileOutputStream fOut = null;
            try 
            { 
                fOut = new FileOutputStream(file);
                image.compress(Bitmap.CompressFormat.PNG, 100, fOut);
                fOut.flush();
                fOut.close();
            } catch (IOException e) {
 
            } 
        } 
 
        private void deleteFile(final URL tag){
            if (mCacheDir == null) return;
            final File[] files = mCacheDir.listFiles(new FileFilter() {
                @Override 
                public boolean accept(File file) {
                    return file.getName() == getURLFilename(tag);
                }