コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="target"></param>
        /// <param name="header"></param>
        /// <param name="offset"></param>
        protected virtual void WriteHeader(Stream target, EdataHeader header, uint offset)
        {
            target.Seek(offset, SeekOrigin.Begin);

            byte[] rawHeader = MiscUtilities.StructToBytes(header);
            target.Write(rawHeader, 0, rawHeader.Length);
        }
コード例 #2
0
        /// <remarks>
        /// Method based on enohka's code.
        /// See more at: http://github.com/enohka/moddingSuite
        /// </remarks>
        protected virtual void WriteHeader(Stream target, EdataFile edataFile)
        {
            //var sourceEdataHeader = edataFile.Header;
            //var headerPart = new byte[sourceEdataHeader.FileOffset];
            //sourceEdata.Read(headerPart, 0, headerPart.Length);
            //newEdata.Write(headerPart, 0, headerPart.Length);

            var sourceEdataHeader = edataFile.Header;

            byte[] rawHeader = MiscUtilities.StructToBytes(sourceEdataHeader);
            target.Write(rawHeader, 0, rawHeader.Length);
            target.Write(edataFile.PostHeaderData, 0, edataFile.PostHeaderData.Length);
        }