scripts
This commit is contained in:
@@ -0,0 +1,275 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
|
||||
{
|
||||
// Token: 0x02000029 RID: 41
|
||||
public class InflaterInputStream : Stream
|
||||
{
|
||||
// Token: 0x06000114 RID: 276 RVA: 0x000083BD File Offset: 0x000073BD
|
||||
public InflaterInputStream(Stream baseInputStream)
|
||||
: this(baseInputStream, new Inflater(), 4096)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000115 RID: 277 RVA: 0x000083D0 File Offset: 0x000073D0
|
||||
public InflaterInputStream(Stream baseInputStream, Inflater inf)
|
||||
: this(baseInputStream, inf, 4096)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000116 RID: 278 RVA: 0x000083E0 File Offset: 0x000073E0
|
||||
public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
|
||||
{
|
||||
if (baseInputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("baseInputStream");
|
||||
}
|
||||
if (inflater == null)
|
||||
{
|
||||
throw new ArgumentNullException("inflater");
|
||||
}
|
||||
if (bufferSize <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("bufferSize");
|
||||
}
|
||||
this.baseInputStream = baseInputStream;
|
||||
this.inf = inflater;
|
||||
this.inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
|
||||
}
|
||||
|
||||
// Token: 0x17000034 RID: 52
|
||||
// (get) Token: 0x06000117 RID: 279 RVA: 0x00008440 File Offset: 0x00007440
|
||||
// (set) Token: 0x06000118 RID: 280 RVA: 0x00008448 File Offset: 0x00007448
|
||||
public bool IsStreamOwner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isStreamOwner;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.isStreamOwner = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000119 RID: 281 RVA: 0x00008454 File Offset: 0x00007454
|
||||
public long Skip(long count)
|
||||
{
|
||||
if (count <= 0L)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
if (this.baseInputStream.CanSeek)
|
||||
{
|
||||
this.baseInputStream.Seek(count, SeekOrigin.Current);
|
||||
return count;
|
||||
}
|
||||
int num = 2048;
|
||||
if (count < (long)num)
|
||||
{
|
||||
num = (int)count;
|
||||
}
|
||||
byte[] array = new byte[num];
|
||||
int num2 = 1;
|
||||
long num3 = count;
|
||||
while (num3 > 0L && num2 > 0)
|
||||
{
|
||||
if (num3 < (long)num)
|
||||
{
|
||||
num = (int)num3;
|
||||
}
|
||||
num2 = this.baseInputStream.Read(array, 0, num);
|
||||
num3 -= (long)num2;
|
||||
}
|
||||
return count - num3;
|
||||
}
|
||||
|
||||
// Token: 0x0600011A RID: 282 RVA: 0x000084D1 File Offset: 0x000074D1
|
||||
protected void StopDecrypting()
|
||||
{
|
||||
this.inputBuffer.CryptoTransform = null;
|
||||
}
|
||||
|
||||
// Token: 0x17000035 RID: 53
|
||||
// (get) Token: 0x0600011B RID: 283 RVA: 0x000084DF File Offset: 0x000074DF
|
||||
public virtual int Available
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!this.inf.IsFinished)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600011C RID: 284 RVA: 0x000084F4 File Offset: 0x000074F4
|
||||
protected void Fill()
|
||||
{
|
||||
if (this.inputBuffer.Available <= 0)
|
||||
{
|
||||
this.inputBuffer.Fill();
|
||||
if (this.inputBuffer.Available <= 0)
|
||||
{
|
||||
throw new SharpZipBaseException("Unexpected EOF");
|
||||
}
|
||||
}
|
||||
this.inputBuffer.SetInflaterInput(this.inf);
|
||||
}
|
||||
|
||||
// Token: 0x17000036 RID: 54
|
||||
// (get) Token: 0x0600011D RID: 285 RVA: 0x00008544 File Offset: 0x00007544
|
||||
public override bool CanRead
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.baseInputStream.CanRead;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000037 RID: 55
|
||||
// (get) Token: 0x0600011E RID: 286 RVA: 0x00008551 File Offset: 0x00007551
|
||||
public override bool CanSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000038 RID: 56
|
||||
// (get) Token: 0x0600011F RID: 287 RVA: 0x00008554 File Offset: 0x00007554
|
||||
public override bool CanWrite
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000039 RID: 57
|
||||
// (get) Token: 0x06000120 RID: 288 RVA: 0x00008557 File Offset: 0x00007557
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (long)this.inputBuffer.RawLength;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700003A RID: 58
|
||||
// (get) Token: 0x06000121 RID: 289 RVA: 0x00008565 File Offset: 0x00007565
|
||||
// (set) Token: 0x06000122 RID: 290 RVA: 0x00008572 File Offset: 0x00007572
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.baseInputStream.Position;
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException("InflaterInputStream Position not supported");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000123 RID: 291 RVA: 0x0000857E File Offset: 0x0000757E
|
||||
public override void Flush()
|
||||
{
|
||||
this.baseInputStream.Flush();
|
||||
}
|
||||
|
||||
// Token: 0x06000124 RID: 292 RVA: 0x0000858B File Offset: 0x0000758B
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotSupportedException("Seek not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000125 RID: 293 RVA: 0x00008597 File Offset: 0x00007597
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException("InflaterInputStream SetLength not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000126 RID: 294 RVA: 0x000085A3 File Offset: 0x000075A3
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotSupportedException("InflaterInputStream Write not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000127 RID: 295 RVA: 0x000085AF File Offset: 0x000075AF
|
||||
public override void WriteByte(byte value)
|
||||
{
|
||||
throw new NotSupportedException("InflaterInputStream WriteByte not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000128 RID: 296 RVA: 0x000085BB File Offset: 0x000075BB
|
||||
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
|
||||
{
|
||||
throw new NotSupportedException("InflaterInputStream BeginWrite not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000129 RID: 297 RVA: 0x000085C7 File Offset: 0x000075C7
|
||||
public override void Close()
|
||||
{
|
||||
if (!this.isClosed)
|
||||
{
|
||||
this.isClosed = true;
|
||||
if (this.isStreamOwner)
|
||||
{
|
||||
this.baseInputStream.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600012A RID: 298 RVA: 0x000085EC File Offset: 0x000075EC
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (this.inf.IsNeedingDictionary)
|
||||
{
|
||||
throw new SharpZipBaseException("Need a dictionary");
|
||||
}
|
||||
int num = count;
|
||||
for (;;)
|
||||
{
|
||||
int num2 = this.inf.Inflate(buffer, offset, num);
|
||||
offset += num2;
|
||||
num -= num2;
|
||||
if (num == 0 || this.inf.IsFinished)
|
||||
{
|
||||
goto IL_65;
|
||||
}
|
||||
if (this.inf.IsNeedingInput)
|
||||
{
|
||||
this.Fill();
|
||||
}
|
||||
else if (num2 == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
throw new ZipException("Dont know what to do");
|
||||
IL_65:
|
||||
return count - num;
|
||||
}
|
||||
|
||||
// Token: 0x040000A5 RID: 165
|
||||
protected Inflater inf;
|
||||
|
||||
// Token: 0x040000A6 RID: 166
|
||||
protected InflaterInputBuffer inputBuffer;
|
||||
|
||||
// Token: 0x040000A7 RID: 167
|
||||
private Stream baseInputStream;
|
||||
|
||||
// Token: 0x040000A8 RID: 168
|
||||
protected long csize;
|
||||
|
||||
// Token: 0x040000A9 RID: 169
|
||||
private bool isClosed;
|
||||
|
||||
// Token: 0x040000AA RID: 170
|
||||
private bool isStreamOwner = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user