private VhdCookie CreateVhdCookie(byte[] cookie)
        {
            var vhdCookie = new VhdCookie(VhdCookieType.Footer, cookie);

            if (!vhdCookie.IsValid())
            {
                throw new VhdParsingException(String.Format("Invalid Vhd footer cookie:{0}", vhdCookie.StringData));
            }
            return(vhdCookie);
        }
        private VhdCookie EndReadHeaderCookie(IAsyncResult result)
        {
            var value     = dataReader.EndReadBytes(result);
            var vhdCookie = new VhdCookie(VhdCookieType.Header, value);

            if (!vhdCookie.IsValid())
            {
                throw new VhdParsingException(String.Format("unsupported format, Cookie:{0}", vhdCookie));
            }
            return(vhdCookie);
        }
        private VhdCookie ReadHeaderCookie(VhdPropertyAttribute attribute)
        {
            var cookie    = dataReader.ReadBytes(headerOffset + attribute.Offset, attribute.Size);
            var vhdCookie = new VhdCookie(VhdCookieType.Header, cookie);

            if (!vhdCookie.IsValid())
            {
                throw new VhdParsingException(String.Format("unsupported format, Cookie:{0}", vhdCookie));
            }
            return(vhdCookie);
        }