src/main/java/org/jcodec/containers/mkv/util/EbmlUtil.java
public static int ebmlLength(long v) {
        if (v == 0)
            return 1;

        int length = 8;

        while (length > 0 && (v & ebmlLengthMasks[length]) == 0)
            length--;

        return length;
    }
public static int ebmlLength(long v) {
        if (v == 0)
            return 1;

        int length = 8;

        while (length > 0 && (v & ebmlLengthMasks[length]) == 0)
            length--;

        return length;
    }
This method is used mostly during writing EBML bitstream. It answers the following question "How many bytes should be used to encode unsigned integer value"

@param v
unsigned integer to be encoded
@return