Rhea.Compression
Rhea.Compression copied to clipboard
Compressed string consisting of only "X" fails to decompress
var text = new string('X', 1000);
var compressDebug = compressionHandler.CompressDebug(text);
var d = compressionHandler.DecompressDebug(compressDebug); // throws IndexOutOfRangeException on line 73 in SubstringUnpacker
seem a quick & dirty fix is to change it to:
var bytes = buffer.GetBuffer();
for (int i = 0; i < length; i++)
{
// if buffer was resized, get the new one
if (this.buffer.Capacity > bytes.Length)
bytes = buffer.GetBuffer();
buffer.WriteByte(bytes[i + currentIndex + offset]);
}