switch(mode)
if(read)
    public static VMOpenMode valueOf(int mode)    {        // These are mode values for open().        VMOpenMode value = null;                switch(mode)        {        case FileChannelImpl.READ: value = READ; break;        case FileChannelImpl.WRITE: value = WRITE; break;        case FileChannelImpl.APPEND: value = READ_WRITE; break;                //TODO: valueOf for EXCL, SYNC, DSYNC and combination of the 6 values                       case FileChannelImpl.EXCL:        case FileChannelImpl.SYNC:        case FileChannelImpl.DSYNC:                default: value = null; break;                }                log.debug("mode="+mode+" VMOpenMode="+value);                return value;    }