Exemplo n.º 1
0
        public static RegData FromBytes(byte[] array, int startIndex)
        {
            RegData value = new RegData();

            value._time = DateTime.FromBinary(BitConverter.ToInt64(array, startIndex));
            value._data = new ushort[6];
            Buffer.BlockCopy(array, startIndex + 8, value.Row, 0, 6 * 2);

            return(value);
        }
Exemplo n.º 2
0
        public Task <RegData> this[int index]
        {
            get
            {
                return(Task.Run(() =>
                {
                    _serialized.Position = index * ENTRY_LENGTH + DATA_OFFSET;
                    var data = _serialized.Read(ENTRY_LENGTH);

                    return RegData.FromBytes(data, 0);
                }));
            }
        }