Line | |
---|
1 | /*
|
---|
2 | * RawCoder
|
---|
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;
|
---|
11 |
|
---|
12 | class RawCoder {
|
---|
13 | static void validate(FilterCoder[] filters)
|
---|
14 | throws UnsupportedOptionsException {
|
---|
15 | for (int i = 0; i < filters.length - 1; ++i)
|
---|
16 | if (!filters[i].nonLastOK())
|
---|
17 | throw new UnsupportedOptionsException(
|
---|
18 | "Unsupported XZ filter chain");
|
---|
19 |
|
---|
20 | if (!filters[filters.length - 1].lastOK())
|
---|
21 | throw new UnsupportedOptionsException(
|
---|
22 | "Unsupported XZ filter chain");
|
---|
23 |
|
---|
24 | int changesSizeCount = 0;
|
---|
25 | for (int i = 0; i < filters.length; ++i)
|
---|
26 | if (filters[i].changesSize())
|
---|
27 | ++changesSizeCount;
|
---|
28 |
|
---|
29 | if (changesSizeCount > 3)
|
---|
30 | throw new UnsupportedOptionsException(
|
---|
31 | "Unsupported XZ filter chain");
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.