private static byte asByte(int arg) {
        if (arg > Byte.MAX_VALUE || arg < Byte.MIN_VALUE)
            throw new ArithmeticException("byte overflow");
        return (byte) arg;
    }
@author Daniel Kuppitz (http://gremlin.guru)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/NumberHelper.java