using System; using System.IO; using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 { // Token: 0x02001E80 RID: 7808 [Token(Token = "0x2001E80")] internal class DefiniteLengthInputStream : LimitedInputStream { // Token: 0x0600C3A8 RID: 50088 RVA: 0x002C3528 File Offset: 0x002C1728 [Token(Token = "0x600C3A8")] [Address(RVA = "0x23A53D0", Offset = "0x23A43D0", VA = "0x1823A53D0")] internal DefiniteLengthInputStream(Stream inStream, int length) : base(inStream, length) { this._originalLength = length; this._remaining = length; if (length == 0) { int remaining = this.GetRemaining(); } } // Token: 0x17001E47 RID: 7751 // (get) Token: 0x0600C3A9 RID: 50089 RVA: 0x002C3568 File Offset: 0x002C1768 [Token(Token = "0x17001E47")] internal int Remaining { [Token(Token = "0x600C3A9")] [Address(RVA = "0x696840", Offset = "0x695840", VA = "0x180696840")] get { return this._remaining; } } // Token: 0x0600C3AA RID: 50090 RVA: 0x002C357C File Offset: 0x002C177C [Token(Token = "0x600C3AA")] [Address(RVA = "0x23A4DD0", Offset = "0x23A3DD0", VA = "0x1823A4DD0", Slot = "28")] public override int ReadByte() { if (this._remaining != 0) { Stream @in = this._in; int num; if (num == 0) { int remaining = this.GetRemaining(); } return num; } object[] array = new object[4]; throw new NullReferenceException(); } // Token: 0x0600C3AB RID: 50091 RVA: 0x002C360C File Offset: 0x002C180C [Token(Token = "0x600C3AB")] [Address(RVA = "0x23A4F90", Offset = "0x23A3F90", VA = "0x1823A4F90", Slot = "27")] public override int Read(byte[] buf, int off, int len) { int remaining = this._remaining; if (remaining != 0) { int num = Math.Min(len, remaining); Stream @in = this._in; if (num == 1) { int remaining2 = this.GetRemaining(); } } return 0; } // Token: 0x0600C3AC RID: 50092 RVA: 0x002C36A4 File Offset: 0x002C18A4 [Token(Token = "0x600C3AC")] [Address(RVA = "0x23A4BF0", Offset = "0x23A3BF0", VA = "0x1823A4BF0")] internal void ReadAllIntoByteArray(byte[] buf) { int num; do { num = this._remaining; } while (num != buf.Length); int num2 = Streams.ReadFully(this._in, buf); num -= num2; this._remaining = num; if (num == buf.Length) { ((IDisposable)this).Dispose(); return; } object[] array = new object[4]; throw new NullReferenceException(); } // Token: 0x0600C3AD RID: 50093 RVA: 0x002C374C File Offset: 0x002C194C [Token(Token = "0x600C3AD")] [Address(RVA = "0x23A5190", Offset = "0x23A4190", VA = "0x1823A5190")] internal byte[] ToArray() { int remaining = this._remaining; if (remaining == 0) { return DefiniteLengthInputStream.EmptyBytes; } byte[] array = new byte[remaining]; Stream @in = this._in; int num = this._remaining; int num2 = Streams.ReadFully(@in, array); num -= num2; this._remaining = num; if (remaining == 0) { int remaining2 = this.GetRemaining(); return array; } object[] array2 = new object[4]; throw new NullReferenceException(); } // Token: 0x04007B62 RID: 31586 [Token(Token = "0x4007B62")] private static readonly byte[] EmptyBytes = new byte[0]; // Token: 0x04007B63 RID: 31587 [FieldOffset(Offset = "0x40")] [Token(Token = "0x4007B63")] private readonly int _originalLength; // Token: 0x04007B64 RID: 31588 [FieldOffset(Offset = "0x44")] [Token(Token = "0x4007B64")] private int _remaining; } }