Code example for RandomAccessFile

Methods: close, getFD

0
 
        RandomAccessFile file = null;
        try { 
            file = new RandomAccessFile(imagePath, "r");
            return BitmapFactory.decodeFileDescriptor(file.getFD(), null,
                    options);
        } catch (IOException e) {
            Ln.d(e, "Could not get cached bitmap.");
            return null; 
        } finally { 
            if (file != null)
                try { 
                    file.close();
                } catch (IOException e) {
                    Ln.d(e, "Could not get cached bitmap.");
                } 
        } 
    } 
 
    /** 
     * Get size of image