Debian Codegraph @

src/org/tukaani/xz/RawCoder.java

raw symbols SCIP
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;
6
7 class RawCoder {
8 static void validate(FilterCoder[] filters)
9 throws UnsupportedOptionsException {
10 for (int i = 0; i < filters.length - 1; ++i)
11 if (!filters[i].nonLastOK())
12 throw new UnsupportedOptionsException(
13 "Unsupported XZ filter chain");
14
15 if (!filters[filters.length - 1].lastOK())
16 throw new UnsupportedOptionsException(
17 "Unsupported XZ filter chain");
18
19 int changesSizeCount = 0;
20 for (int i = 0; i < filters.length; ++i)
21 if (filters[i].changesSize())
22 ++changesSizeCount;
23
24 if (changesSizeCount > 3)
25 throw new UnsupportedOptionsException(
26 "Unsupported XZ filter chain");
27 }
28 }