// Decompiled with JetBrains decompiler
// Type: .
// Assembly: WindowsBC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9909ee17073e3364
// MVID: 658BFC85-36E1-493D-98E6-AE9127D73D60
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Downloader.MSIL.BitCoinMiner.c-64f742a0b28b2c3d2a62ef6607fcfd5fa55b793a1aff3a6c11e014e3b119149e.exe

using \u000E;
using \u0010\u0002;
using ICSharpCode.SharpZipLib.Tar;
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace \u0010\u0002
{
  internal sealed class \u0015\u0002 : Stream
  {
    private long \u0001;
    private int \u0002;
    private bool \u0003;
    protected long \u0004;
    protected byte[] \u0005;
    protected byte[] \u0006;
    protected \u0011\u0002 \u0007;
    protected Stream \u0008;

    [SpecialName]
    public override bool get_CanRead() => \u0007\u0003.\u007E\u009E\u0004((object) this.\u0008);

    [SpecialName]
    public override bool get_CanSeek() => \u0007\u0003.\u007E\u009F\u0004((object) this.\u0008);

    [SpecialName]
    public override bool get_CanWrite() => \u0007\u0003.\u007E\u0002\u0005((object) this.\u0008);

    [SpecialName]
    public override long get_Length() => \u007F\u0004.\u007E\u0003\u0005((object) this.\u0008);

    [SpecialName]
    public override long get_Position() => \u007F\u0004.\u007E\u0004\u0005((object) this.\u0008);

    [SpecialName]
    public override void set_Position([In] long obj0) => \u009F\u0004.\u007E\u0005\u0005((object) this.\u0008, obj0);

    public override long Seek([In] long obj0, [In] SeekOrigin obj1) => \u0015\u0004.\u007E\u0008\u0005((object) this.\u0008, obj0, obj1);

    public override void SetLength([In] long obj0) => \u009F\u0004.\u007E\u000E\u0005((object) this.\u0008, obj0);

    public override int ReadByte() => \u0011\u0003.\u007E\u0010\u0005((object) this.\u0008);

    public override int Read([In] byte[] obj0, [In] int obj1, [In] int obj2) => \u0089\u0005.\u007E\u000F\u0005((object) this.\u0008, obj0, obj1, obj2);

    public override void Flush() => \u0093\u0003.\u007E\u0007\u0005((object) this.\u0008);

    public void \u0080\u0004()
    {
      if (this.\u0081\u0004())
        goto label_2;
label_1:
      this.\u0083\u0004();
      return;
label_2:
      this.\u0082\u0004();
      goto label_1;
    }

    public override void Close()
    {
      if (this.\u0003)
        return;
      this.\u0003 = true;
      this.\u0080\u0004();
      this.\u0007.Close();
    }

    [SpecialName]
    private bool \u0081\u0004() => this.\u0001 < this.\u0004;

    public void \u0082\u0004()
    {
      if (this.\u0002 > 0)
      {
        \u0099\u0004.\u0099((Array) this.\u0006, this.\u0002, this.\u0006.Length - this.\u0002);
        this.\u0007.\u0002\u0004(this.\u0006);
        this.\u0001 += (long) this.\u0002;
        this.\u0002 = 0;
      }
      if (this.\u0001 < this.\u0004)
        throw new TarException(\u001D\u0003.\u001A\u0002(\u0008.\u000E\u0003(2863), (object) this.\u0001, (object) this.\u0004));
    }

    public override void WriteByte([In] byte obj0) => \u001F\u0004.\u007E\u0011\u0005((object) this, new byte[1]
    {
      obj0
    }, 0, 1);

    public override void Write([In] byte[] obj0, [In] int obj1, [In] int obj2)
    {
      if (obj0 == null)
        throw new ArgumentNullException(\u0008.\u000E\u0003(568));
      if (obj1 < 0)
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(577), \u0008.\u000E\u0003(2972));
      if (obj0.Length - obj1 < obj2)
        throw new ArgumentException(\u0008.\u000E\u0003(2997));
      if (obj2 < 0)
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(611), \u0008.\u000E\u0003(2972));
      if (this.\u0001 + (long) obj2 > this.\u0004)
      {
        string message = \u001D\u0003.\u001A\u0002(\u0008.\u000E\u0003(3050), (object) obj2, (object) this.\u0004);
        throw new ArgumentOutOfRangeException(\u0008.\u000E\u0003(611), message);
      }
      if (this.\u0002 > 0)
      {
        if (this.\u0002 + obj2 >= this.\u0005.Length)
        {
          int num = this.\u0005.Length - this.\u0002;
          \u008F\u0003.\u0098((Array) this.\u0006, 0, (Array) this.\u0005, 0, this.\u0002);
          \u008F\u0003.\u0098((Array) obj0, obj1, (Array) this.\u0005, this.\u0002, num);
          this.\u0007.\u0002\u0004(this.\u0005);
          this.\u0001 += (long) this.\u0005.Length;
          obj1 += num;
          obj2 -= num;
          this.\u0002 = 0;
        }
        else
        {
          \u008F\u0003.\u0098((Array) obj0, obj1, (Array) this.\u0006, this.\u0002, obj2);
          obj1 += obj2;
          this.\u0002 += obj2;
          obj2 -= obj2;
        }
      }
      while (obj2 > 0)
      {
        if (obj2 < this.\u0005.Length)
        {
          \u008F\u0003.\u0098((Array) obj0, obj1, (Array) this.\u0006, this.\u0002, obj2);
          this.\u0002 += obj2;
          break;
        }
        this.\u0007.\u0002\u0004(obj0, obj1);
        int length = this.\u0005.Length;
        this.\u0001 += (long) length;
        obj2 -= length;
        obj1 += length;
      }
    }

    private void \u0083\u0004()
    {
      \u0099\u0004.\u0099((Array) this.\u0005, 0, this.\u0005.Length);
      this.\u0007.\u0002\u0004(this.\u0005);
    }
  }
}
