| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * DeltaCoder
|
|---|
| 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.delta;
|
|---|
| 11 |
|
|---|
| 12 | abstract class DeltaCoder {
|
|---|
| 13 | static final int DISTANCE_MIN = 1;
|
|---|
| 14 | static final int DISTANCE_MAX = 256;
|
|---|
| 15 | static final int DISTANCE_MASK = DISTANCE_MAX - 1;
|
|---|
| 16 |
|
|---|
| 17 | final int distance;
|
|---|
| 18 | final byte[] history = new byte[DISTANCE_MAX];
|
|---|
| 19 | int pos = 0;
|
|---|
| 20 |
|
|---|
| 21 | DeltaCoder(int distance) {
|
|---|
| 22 | if (distance < DISTANCE_MIN || distance > DISTANCE_MAX)
|
|---|
| 23 | throw new IllegalArgumentException();
|
|---|
| 24 |
|
|---|
| 25 | this.distance = distance;
|
|---|
| 26 | }
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.