24 namespace Lucene.Net.Support
28 delegate
void SetInputDelegate(byte[] buffer);
29 delegate
bool GetIsFinishedDelegate();
30 delegate
int InflateDelegate(byte[] buffer);
32 SetInputDelegate setInputMethod;
33 GetIsFinishedDelegate getIsFinishedMethod;
34 InflateDelegate inflateMethod;
36 internal Inflater(
object inflaterInstance)
38 Type type = inflaterInstance.GetType();
40 setInputMethod = (SetInputDelegate)Delegate.CreateDelegate(
41 typeof(SetInputDelegate),
43 type.GetMethod(
"SetInput",
new Type[] { typeof(byte[]) }));
45 getIsFinishedMethod = (GetIsFinishedDelegate)Delegate.CreateDelegate(
46 typeof(GetIsFinishedDelegate),
48 type.GetMethod(
"get_IsFinished", Type.EmptyTypes));
50 inflateMethod = (InflateDelegate)Delegate.CreateDelegate(
51 typeof(InflateDelegate),
53 type.GetMethod(
"Inflate",
new Type[] { typeof(byte[]) }));
56 public void SetInput(byte[] buffer)
58 setInputMethod(buffer);
61 public bool IsFinished
63 get {
return getIsFinishedMethod(); }
66 public int Inflate(byte[] buffer)
68 return inflateMethod(buffer);