private DoubleData readNextFrame()
        {
            int num  = 0;
            int num2 = this.bytesPerRead;

            byte[]     array             = new byte[this.bytesPerRead];
            long       firstSampleNumber = this.totalValuesRead;
            DoubleData result;

            try
            {
                int num3;
                do
                {
                    num3 = this.dataStream.read(array, num, num2 - num);
                    if (num3 > 0)
                    {
                        num += num3;
                    }
                }while (num3 != -1 && num < num2);
                if (num > 0)
                {
                    long num4 = this.totalValuesRead;
                    int  num5 = num;
                    int  num6 = this.bytesPerValue;
                    this.totalValuesRead = num4 + (long)((num6 != -1) ? (num5 / num6) : (-(long)num5));
                    if (num < num2)
                    {
                        bool flag = num != 0;
                        int  num7 = 2;
                        num = ((num7 != -1 && (flag ? 1 : 0) % num7 != 0) ? (num + 3) : (num + 2));
                        byte[] array2 = new byte[num];
                        ByteCodeHelper.arraycopy_primitive_1(array, 0, array2, 0, num);
                        array = array2;
                        this.closeDataStream();
                    }
                    goto IL_B9;
                }
                this.closeDataStream();
                result = null;
            }
            catch (IOException ex)
            {
                throw new DataProcessingException("Error reading data", ex);
            }
            return(result);

IL_B9:
            double[] values;
            if (this.bigEndian)
            {
                values = DataUtil.bytesToValues(array, 0, num, this.bytesPerValue, this.signedData);
            }
            else
            {
                values = DataUtil.littleEndianBytesToValues(array, 0, num, this.bytesPerValue, this.signedData);
            }
            return(new DoubleData(values, this.sampleRate, firstSampleNumber));
        }
Пример #2
0
 public virtual byte[] cleanData()
 {
     if ((this.offset == 0) && (this.len == this.data.Length))
     {
         return(this.data);
     }
     byte[] buffer = new byte[this.len];
     ByteCodeHelper.arraycopy_primitive_1(this.data, this.offset, buffer, 0, this.len);
     return(buffer);
 }
Пример #3
0
 public KeyParameter(byte[] key, int keyOff, int keyLen)
 {
     this.key = new byte[keyLen];
     ByteCodeHelper.arraycopy_primitive_1(key, keyOff, this.key, 0, keyLen);
 }
Пример #4
0
 public override byte[] loadBuffer(long position, int size)
 {
     byte[] array = new byte[size];
     ByteCodeHelper.arraycopy_primitive_1(this.modelData, (int)position, array, 0, size);
     return(array);
 }