Code example for RandomAccessFile

Methods: closereadByte

     * @return Whether a saved pattern exists. 
    public boolean savedPatternExists() { 
        try { 
            // Check if we can read a byte from the file 
            RandomAccessFile raf = new RandomAccessFile(sLockPatternFilename, "r");
            byte first = raf.readByte();
            return true; 
        } catch (FileNotFoundException fnfe) {
            return false; 
        } catch (IOException ioe) {
            return false; 
     * Return true if the user has ever chosen a pattern.  This is true even if the pattern is 
     * currently cleared. 
Contextual code suggestions in your IDE  Get Codota for Java