GSF.Historian.Files.StateRecord.ParseBinaryImage C# (CSharp) Method

ParseBinaryImage() public method

Initializes StateRecord from the specified buffer.
public ParseBinaryImage ( byte buffer, int startIndex, int length ) : int
buffer byte Binary image to be used for initializing .
startIndex int 0-based starting index of initialization data in the .
length int Valid number of bytes in from .
return int
        public int ParseBinaryImage(byte[] buffer, int startIndex, int length)
        {
            if (length >= FixedLength)
            {
                // Binary image has sufficient data.
                m_archivedData.ParseBinaryImage(buffer, startIndex, length);
                m_previousData.ParseBinaryImage(buffer, startIndex + 16, length - 16);
                m_currentData.ParseBinaryImage(buffer, startIndex + 32, length - 32);
                ActiveDataBlockIndex = LittleEndian.ToInt32(buffer, startIndex + 48) - 1;
                ActiveDataBlockSlot = LittleEndian.ToInt32(buffer, startIndex + 52);
                Slope1 = LittleEndian.ToDouble(buffer, startIndex + 56);
                Slope2 = LittleEndian.ToDouble(buffer, startIndex + 64);

                return FixedLength;
            }
            else
            {
                // Binary image does not have sufficient data.
                return 0;
            }
        }