UcfbHelper.cs
/// <summary>
/// Throws exception if file isn't ucfb
/// </summary>
/// <param name="mungedFile">the mungd file to add to the end</param>
Throws exception if file isn't ucfb
Throws exception if file isn ' t ucfb
public void AddItemToEnd(string mungedFile)
        {
            Munger.VerifyUcfbFile(mungedFile);
            byte[] newData = File.ReadAllBytes(mungedFile);
            List<byte> bigData = new List<byte>(this.mData);
            int newDataStart = bigData.Count;
            bigData.AddRange(newData);
            bigData.RemoveRange(newDataStart, 8);
            mData = bigData.ToArray();
            int headerLength = mData.Length - 8; 
            mData[4] = (byte)(headerLength & 0x000000FF);
            mData[5] = (byte)((headerLength & 0x0000FF00) >> 8);
            mData[6] = (byte)((headerLength & 0x00FF0000) >> 16);
            mData[7] = (byte)((headerLength & 0xFF000000) >> 24);
        }
public void AddItemToEnd ( string mungedFile ) { Munger . VerifyUcfbFile ( mungedFile ) ; byte [ ] newData = File . ReadAllBytes ( mungedFile ) ; List < byte > bigData = new List < byte > ( this . mData ) ; int newDataStart = bigData . Count ; bigData . AddRange ( newData ) ; bigData . RemoveRange ( newDataStart , 8 ) ; mData = bigData . ToArray ( ) ; int headerLength = mData . Length - 8 ; mData [ 4 ] = ( byte ) ( headerLength & 0x000000FF ) ; mData [ 5 ] = ( byte ) ( ( headerLength & 0x0000FF00 ) >> 8 ) ; mData [ 6 ] = ( byte ) ( ( headerLength & 0x00FF0000 ) >> 16 ) ; mData [ 7 ] = ( byte ) ( ( headerLength & 0xFF000000 ) >> 24 ) ; }
Throws exception if file isn't ucfb
Throws exception if file isn ' t ucfb
// this will throw if file isn't ucfb // throw away the first 8 bytes of munged data // gotta put this at locs 4-7
mungedFile
string
the mungd file to add to the end
the mungd file to add to the end