Correcting behavior when the clear dictionary code is received (0x100).

This commit is contained in:
Robert Greene 2008-06-27 18:42:26 +00:00
parent aad7071358
commit f11ba01ee2
1 changed files with 6 additions and 15 deletions

View File

@ -74,7 +74,12 @@ public class LzwInputStream extends InputStream {
return;
}
if (k == 0x100) {
clearDictionary();
dictionary = null;
is.setRequestedNumberOfBits(9);
k = 0;
w = null;
entry = null;
newBuffer = true;
fillBuffer(); // Warning: recursive call
return;
}
@ -115,20 +120,6 @@ public class LzwInputStream extends InputStream {
newBuffer = true;
}
// /**
// * Provide necessary housekeeping to reset LZW stream between NuFX buffer changes.
// * The dictionary is the only item that is not cleared -- that needs to be done
// * explicitly since behavior between LZW/1 and LZW/2 differ.
// */
// public void resetState() {
// is.clearRemainingBitsOfData();
// outputBuffer.clear();
// k = 0;
// w = null;
// entry = null;
// newBuffer = true;
// }
/**
* Provide necessary housekeeping to reset LZW stream between NuFX buffer changes.
* The dictionary is the only item that is not cleared -- that needs to be done