| 1 |
|
| 2 |
|
| 3 |
|
| 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 |
} |