source: josm/trunk/src/org/tukaani/xz/delta/DeltaDecoder.java@ 13521

Last change on this file since 13521 was 13350, checked in by stoecker, 7 years ago

see #15816 - add XZ support

File size: 591 bytes
Line 
1/*
2 * DeltaDecoder
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
10package org.tukaani.xz.delta;
11
12public class DeltaDecoder extends DeltaCoder {
13 public DeltaDecoder(int distance) {
14 super(distance);
15 }
16
17 public void decode(byte[] buf, int off, int len) {
18 int end = off + len;
19 for (int i = off; i < end; ++i) {
20 buf[i] += history[(distance + pos) & DISTANCE_MASK];
21 history[pos-- & DISTANCE_MASK] = buf[i];
22 }
23 }
24}
Note: See TracBrowser for help on using the repository browser.