using System; namespace ICSharpCode.SharpZipLib.Zip.Compression { // Token: 0x02000045 RID: 69 public class PendingBuffer { // Token: 0x060002BA RID: 698 RVA: 0x0000F1D9 File Offset: 0x0000E1D9 public PendingBuffer() : this(4096) { } // Token: 0x060002BB RID: 699 RVA: 0x0000F1E6 File Offset: 0x0000E1E6 public PendingBuffer(int bufferSize) { this.buffer_ = new byte[bufferSize]; } // Token: 0x060002BC RID: 700 RVA: 0x0000F1FC File Offset: 0x0000E1FC public void Reset() { this.start = (this.end = (this.bitCount = 0)); } // Token: 0x060002BD RID: 701 RVA: 0x0000F224 File Offset: 0x0000E224 public void WriteByte(int value) { this.buffer_[this.end++] = (byte)value; } // Token: 0x060002BE RID: 702 RVA: 0x0000F24C File Offset: 0x0000E24C public void WriteShort(int value) { this.buffer_[this.end++] = (byte)value; this.buffer_[this.end++] = (byte)(value >> 8); } // Token: 0x060002BF RID: 703 RVA: 0x0000F290 File Offset: 0x0000E290 public void WriteInt(int value) { this.buffer_[this.end++] = (byte)value; this.buffer_[this.end++] = (byte)(value >> 8); this.buffer_[this.end++] = (byte)(value >> 16); this.buffer_[this.end++] = (byte)(value >> 24); } // Token: 0x060002C0 RID: 704 RVA: 0x0000F30D File Offset: 0x0000E30D public void WriteBlock(byte[] block, int offset, int length) { Array.Copy(block, offset, this.buffer_, this.end, length); this.end += length; } // Token: 0x17000094 RID: 148 // (get) Token: 0x060002C1 RID: 705 RVA: 0x0000F331 File Offset: 0x0000E331 public int BitCount { get { return this.bitCount; } } // Token: 0x060002C2 RID: 706 RVA: 0x0000F33C File Offset: 0x0000E33C public void AlignToByte() { if (this.bitCount > 0) { this.buffer_[this.end++] = (byte)this.bits; if (this.bitCount > 8) { this.buffer_[this.end++] = (byte)(this.bits >> 8); } } this.bits = 0U; this.bitCount = 0; } // Token: 0x060002C3 RID: 707 RVA: 0x0000F3AC File Offset: 0x0000E3AC public void WriteBits(int b, int count) { this.bits |= (uint)((uint)b << this.bitCount); this.bitCount += count; if (this.bitCount >= 16) { this.buffer_[this.end++] = (byte)this.bits; this.buffer_[this.end++] = (byte)(this.bits >> 8); this.bits >>= 16; this.bitCount -= 16; } } // Token: 0x060002C4 RID: 708 RVA: 0x0000F448 File Offset: 0x0000E448 public void WriteShortMSB(int s) { this.buffer_[this.end++] = (byte)(s >> 8); this.buffer_[this.end++] = (byte)s; } // Token: 0x17000095 RID: 149 // (get) Token: 0x060002C5 RID: 709 RVA: 0x0000F48B File Offset: 0x0000E48B public bool IsFlushed { get { return this.end == 0; } } // Token: 0x060002C6 RID: 710 RVA: 0x0000F498 File Offset: 0x0000E498 public int Flush(byte[] output, int offset, int length) { if (this.bitCount >= 8) { this.buffer_[this.end++] = (byte)this.bits; this.bits >>= 8; this.bitCount -= 8; } if (length > this.end - this.start) { length = this.end - this.start; Array.Copy(this.buffer_, this.start, output, offset, length); this.start = 0; this.end = 0; } else { Array.Copy(this.buffer_, this.start, output, offset, length); this.start += length; } return length; } // Token: 0x060002C7 RID: 711 RVA: 0x0000F550 File Offset: 0x0000E550 public byte[] ToByteArray() { byte[] array = new byte[this.end - this.start]; Array.Copy(this.buffer_, this.start, array, 0, array.Length); this.start = 0; this.end = 0; return array; } // Token: 0x040001C4 RID: 452 private byte[] buffer_; // Token: 0x040001C5 RID: 453 private int start; // Token: 0x040001C6 RID: 454 private int end; // Token: 0x040001C7 RID: 455 private uint bits; // Token: 0x040001C8 RID: 456 private int bitCount; } }