Exemple #1
0
 public void method_1()
 {
     if (!_bool0)
     {
         try
         {
             var num = 0u;
             if (_int2 > 0 && LameEncoder.smethod_0(_uint0, _byte0, 0, (uint)_int2, _byte1, ref num) == 0u &&
                 num > 0u)
             {
                 base.Write(_byte1, 0, (int)num);
             }
             num = 0u;
             if (LameEncoder.beDeinitStream(_uint0, _byte1, ref num) == 0u && num > 0u)
             {
                 base.Write(_byte1, 0, (int)num);
             }
         }
         finally
         {
             LameEncoder.beCloseStream(_uint0);
         }
     }
     _bool0 = true;
 }
Exemple #2
0
        public override void Write(byte[] buffer, int offset, int count)
        {
            var num = 0u;

            while (count > 0)
            {
                if (_int2 > 0)
                {
                    var num2 = Math.Min(count, _byte0.Length - _int2);
                    Buffer.BlockCopy(buffer, offset, _byte0, _int2, num2);
                    _int2  += num2;
                    offset += num2;
                    count  -= num2;
                    if (_int2 >= _byte0.Length)
                    {
                        _int2 = 0;
                        var num3 = LameEncoder.smethod_1(_uint0, _byte0, _byte1, ref num);
                        if (num3 != 0u)
                        {
                            throw new ApplicationException("Lame_encDll.EncodeChunk failed with the error code " +
                                                           num3);
                        }
                        if (num > 0u)
                        {
                            Stream0.Write(_byte1, 0, (int)num);
                        }
                    }
                }
                else if (count >= _byte0.Length)
                {
                    var num3 = LameEncoder.smethod_0(_uint0, buffer, offset, (uint)_byte0.Length, _byte1, ref num);
                    if (num3 != 0u)
                    {
                        throw new ApplicationException("Lame_encDll.EncodeChunk failed with the error code " + num3);
                    }
                    if (num > 0u)
                    {
                        Stream0.Write(_byte1, 0, (int)num);
                    }
                    count  -= _byte0.Length;
                    offset += _byte0.Length;
                }
                else
                {
                    Buffer.BlockCopy(buffer, offset, _byte0, 0, count);
                    _int2   = count;
                    offset += count;
                    count   = 0;
                }
            }
        }