Beispiel #1
0
        private byte[] BuildExtendedInfo()
        {
            if (ExtendedInfo != null)
            {
                if (ExtendedInfo.Length != 48)
                {
                    throw new ArgumentException("Extended info needs to be 48 bytes in length.");
                }
                return(ExtendedInfo);
            }

            if (BirthVolumeId.HasValue || BirthObjectId.HasValue || DomainId.HasValue)
            {
                MemoryStream stm    = new MemoryStream();
                BinaryWriter writer = new BinaryWriter(stm);
                writer.Write(BirthVolumeId?.ToByteArray() ?? new byte[16]);
                writer.Write(BirthObjectId?.ToByteArray() ?? new byte[16]);
                writer.Write(DomainId?.ToByteArray() ?? new byte[16]);
                return(stm.ToArray());
            }

            return(new byte[48]);
        }