public static int[] shape(int[] buffer) {
        int[] ret = new int[rank(buffer)];
        for (int i = 0; i < ret.length; i++)
            ret[i] = buffer[1 + i];
        return ret;
    }
public static int[] shape(int[] buffer) {
        int[] ret = new int[rank(buffer)];
        for (int i = 0; i < ret.length; i++)
            ret[i] = buffer[1 + i];
        return ret;
    }
public static int [ ] shape ( int [ ] buffer ) { int [ ] ret = new int [ rank ( buffer ) ] ; for ( int i = 0 ; i < ret . length ; i ++ ) ret [ i ] = buffer [ 1 + i ] ; return ret ; }
Get array shape from an int[]
@param buffer    Buffer to get the shape from
@return          Shape array
Get array shape from an int []