1 /*
2  * Util
3  *
4  * Author: Lasse Collin <lasse.collin@tukaani.org>
5  *
6  * This file has been put into the public domain.
7  * You can do whatever you want with this file.
8  */
9 
10 package org.tukaani.xz.common;
11 
12 public class Util {
13     public static final int STREAM_HEADER_SIZE = 12;
14     public static final long BACKWARD_SIZE_MAX = 1L << 34;
15     public static final int BLOCK_HEADER_SIZE_MAX = 1024;
16     public static final long VLI_MAX = Long.MAX_VALUE;
17     public static final int VLI_SIZE_MAX = 9;
18 
getVLISize(long num)19     public static int getVLISize(long num) {
20         int size = 0;
21         do {
22             ++size;
23             num >>= 7;
24         } while (num != 0);
25 
26         return size;
27     }
28 }
29