i am a students, i am transform a
code about lz77 decompression in c# from JSCRIPT
this is my c# code
public class lz77DeCompression
{
private char ReferencePrefix;
private int ReferencePrefixCode;
private int ReferenceIntBase;
private int ReferenceIntFloorCode;
private int ReferenceIntCeilCode;
private int MaxStringDistance;
private int MinStringLength;
private int MaxStringLength;
private int MaxWindowLength;
public lz77DeCompression()
{
this.ReferencePrefix ='`';
this.ReferencePrefixCode =
(int)this.ReferencePrefix;
this.ReferenceIntBase = 96;
this.ReferenceIntFloorCode =(int)'
';
this.ReferenceIntCeilCode =
this.ReferenceIntFloorCode + this.ReferenceIntBase -1;
this.MaxStringDistance =
(int)Math.Pow(this.ReferenceIntBase ,2)-1;
this.MinStringLength = 5;
this.MaxStringLength =
(int)Math.Pow(this.ReferenceIntBase, 1) - 1 + this.MinStringLength;
this.MaxWindowLength = this.MaxStringDistance
+ this.MinStringLength;
}
private int decodeReferenceInt(string words, int width)
{
int value;
int i;
int charcode;
value = 0;
for (i = 0; i < width;i++ )
{
value *=
this.ReferenceIntBase;
charcode =
(int)words[i];
if ((charcode >= this.ReferenceIntFloorCode) && (charcode <=
this.ReferenceIntCeilCode))
{
value += charcode - this.ReferenceIntFloorCode;
}
/* else
{
Response.Write ( "