org.tukaani.xz.delta.DeltaEncoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-compress Show documentation
Show all versions of commons-compress Show documentation
This artifact contains the same classes as
${modularized.groupId}%${modularized.artifactId}%${modularized.version}
but also a module-info.class
/*
* DeltaEncoder
*
* Author: Lasse Collin
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
*/
package org.tukaani.xz.delta;
public class DeltaEncoder extends DeltaCoder {
public DeltaEncoder(int distance) {
super(distance);
}
public void encode(byte[] in, int in_off, int len, byte[] out) {
for (int i = 0; i < len; ++i) {
byte tmp = history[(distance + pos) & DISTANCE_MASK];
history[pos-- & DISTANCE_MASK] = in[in_off + i];
out[i] = (byte)(in[in_off + i] - tmp);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy