All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.util.io.STDIO Maven / Gradle / Ivy

There is a newer version: 9.4.7.0
Show newest version
package org.jruby.util.io;

public enum STDIO {

    IN, OUT, ERR;

    public int fileno() {
        switch (this) {
        case IN:
            return 0;
        case OUT:
            return 1;
        case ERR:
            return 2;
        default:
            throw new RuntimeException();
        }
    }

    public static boolean isSTDIO(int fileno) {
        if (fileno >= 0 && fileno <= 2) {
            return true;
        }

        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy