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