Пример #1
0
        public RAID5ManagerBootRecord(byte[] buffer)
        {
            Signature      = ByteReader.ReadAnsiString(buffer, 0, 8);
            RecordRevision = ByteReader.ReadByte(buffer, 8);
            Operation      = (RAID5ManagerOperation)BigEndianConverter.ToUInt16(buffer, 9);

            ReadOperationParameters(buffer, 16);
        }
Пример #2
0
        public static RAID5ManagerBootRecord FromBytes(byte[] buffer)
        {
            string signature                = ByteReader.ReadAnsiString(buffer, 0, 8);
            byte   recordRevision           = ByteReader.ReadByte(buffer, 8);
            RAID5ManagerOperation operation = (RAID5ManagerOperation)BigEndianConverter.ToUInt16(buffer, 9);

            if (signature == ValidSignature && recordRevision == 1)
            {
                if (operation == RAID5ManagerOperation.AddDiskToArray)
                {
                    return(new AddDiskOperationBootRecord(buffer));
                }
                else if (operation == RAID5ManagerOperation.MoveExtent)
                {
                    return(new MoveExtentOperationBootRecord(buffer));
                }
            }
            return(null);
        }