| 1 | // SPDX-License-Identifier: 0BSD |
| 2 | // SPDX-FileCopyrightText: The XZ for Java authors and contributors |
| 3 | // SPDX-FileContributor: Lasse Collin <[email protected]> |
| 4 | |
| 5 | package org.tukaani.xz.common; |
| 6 | |
| 7 | public class Util { |
| 8 | public static final int STREAM_HEADER_SIZE = 12; |
| 9 | public static final long BACKWARD_SIZE_MAX = 1L << 34; |
| 10 | public static final int BLOCK_HEADER_SIZE_MAX = 1024; |
| 11 | public static final long VLI_MAX = Long.MAX_VALUE; |
| 12 | public static final int VLI_SIZE_MAX = 9; |
| 13 | |
| 14 | public static int getVLISize(long num) { |
| 15 | int size = 0; |
| 16 | do { |
| 17 | ++size; |
| 18 | num >>= 7; |
| 19 | } while (num != 0); |
| 20 | |
| 21 | return size; |
| 22 | } |
| 23 | } |