opendap/src/main/java/opendap/dap/BooleanPrimitiveVector.java
public PrimitiveVector subset(int start, int stop, int stride) {
        BooleanPrimitiveVector n = new BooleanPrimitiveVector(getTemplate());
        stride = Math.max(stride, 1);
        stop = Math.max(start, stop);
        int length = 1 + (stop - start) / stride;
        n.setLength(length);

        int count = 0;
        for (int i = start; i <= stop; i += stride) {
            n.setValue(count, vals[i]);
            count++;
        }
        return n;
    }
public PrimitiveVector subset(int start, int stop, int stride) {
        BooleanPrimitiveVector n = new BooleanPrimitiveVector(getTemplate());
        stride = Math.max(stride, 1);
        stop = Math.max(start, stop);
        int length = 1 + (stop - start) / stride;
        n.setLength(length);

        int count = 0;
        for (int i = start; i <= stop; i += stride) {
            n.setValue(count, vals[i]);
            count++;
        }
        return n;
    }
Create a new primitive vector using a subset of the data.

@param start  starting index (i=start)
@param stop  ending index (i<=stop)
@param stride index stride (i+=stride)
@return new primitive vector, of type BooleanPrimitiveVector.