Code example for RandomAccessFile

Methods: closereadByte

     * @return true if file exists and is non-empty. 
    private boolean nonEmptyFileExists(String filename) { 
        try { 
            // Check if we can read a byte from the file 
            RandomAccessFile raf = new RandomAccessFile(filename, "r"); 
            return true; 
        } catch (FileNotFoundException fnfe) { 
            return false; 
        } catch (IOException ioe) { 
            return false; 
     * Check to see if the user has stored a lock pattern. 
     * @return Whether a saved pattern exists. 
Connect your IDE to all the code out there  Get Codota for Java