mirror of
https://github.com/AppleCommander/ShrinkItArchive.git
synced 2025-01-04 22:34:35 +00:00
Preserve 1.5 compatibility.
This commit is contained in:
parent
005b1f4e07
commit
252cd1607a
@ -86,13 +86,17 @@ public class LzwInputStream extends InputStream {
|
|||||||
if (k < dictionary.size()) {
|
if (k < dictionary.size()) {
|
||||||
entry = dictionary.get(k);
|
entry = dictionary.get(k);
|
||||||
} else if (k == dictionary.size()) {
|
} else if (k == dictionary.size()) {
|
||||||
entry = Arrays.copyOf(w, w.length+1);
|
//entry = Arrays.copyOf(w, w.length+1);
|
||||||
|
entry = new int[w.length+1];
|
||||||
|
System.arraycopy(w, 0, entry, 0, w.length);
|
||||||
entry[w.length] = w[0];
|
entry[w.length] = w[0];
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Invalid code of <" + k + "> encountered");
|
throw new IOException("Invalid code of <" + k + "> encountered");
|
||||||
}
|
}
|
||||||
for (int i : entry) outputBuffer.add(i);
|
for (int i : entry) outputBuffer.add(i);
|
||||||
int[] newEntry = Arrays.copyOf(w, w.length+1);
|
//int[] newEntry = Arrays.copyOf(w, w.length+1);
|
||||||
|
int[] newEntry = new int[w.length+1];
|
||||||
|
System.arraycopy(w, 0, newEntry, 0, w.length);
|
||||||
newEntry[w.length] = entry[0];
|
newEntry[w.length] = entry[0];
|
||||||
dictionary.add(newEntry);
|
dictionary.add(newEntry);
|
||||||
w = entry;
|
w = entry;
|
||||||
|
Loading…
Reference in New Issue
Block a user