if(read)
if(read && !write)
    public static VMOpenMode valueOf(int mode)    {        // These are mode values for open().        VMOpenMode value = null;        boolean read = ((mode & FileChannelImpl.READ) == FileChannelImpl.READ);         boolean write = ((mode & FileChannelImpl.WRITE) == FileChannelImpl.WRITE);        boolean append = ((mode & FileChannelImpl.APPEND) == FileChannelImpl.APPEND);                if(read)        {            value = READ;        }        else if(write && !append)        {            value = WRITE;        }        else if(write && append)        {            value = READ_WRITE;        }        else        {            //TODO: valueOf for EXCL, SYNC, DSYNC and combination of the 6 values                           //FileChannelImpl.EXCL:            //FileChannelImpl.SYNC:            //FileChannelImpl.DSYNC:            throw new IllegalArgumentException("unknown open mode: "+mode);        }                return value;    }