Example #1
0
    private void ParseSTCO(BinaryReader br)
    {
        byte [] tmp;
        STCO    stco = new STCO();

        stco.Dummy = br.ReadBytes(4);

        tmp        = br.ReadBytes(4); Utility.LeReverse(tmp);
        stco.Table = new int[BitConverter.ToInt32(tmp, 0)];

        for (int i = 0; i < stco.Table.Length; i++)
        {
            tmp           = br.ReadBytes(4); Utility.LeReverse(tmp);
            stco.Table[i] = BitConverter.ToInt32(tmp, 0);
        }

        this.data = stco;
    }
Example #2
0
    private void WriteBytesSTCO(MemoryStream ms)
    {
        byte [] tmp;
        STCO    stco = (STCO)this.data;

        ms.Write(stco.Dummy, 0, stco.Dummy.Length);

        tmp = BitConverter.GetBytes(stco.Table.Length);
        Utility.LeReverse(tmp);
        ms.Write(tmp, 0, tmp.Length);

        for (int i = 0; i < stco.Table.Length; i++)
        {
            tmp = BitConverter.GetBytes(stco.Table[i]);
            Utility.LeReverse(tmp);
            ms.Write(tmp, 0, tmp.Length);
        }
    }
    private void ParseSTCO( BinaryReader br )
    {
        byte [] tmp;
        STCO stco = new STCO();

        stco.Dummy = br.ReadBytes( 4 );

        tmp = br.ReadBytes( 4 ); Utility.LeReverse( tmp );
        stco.Table = new int[ BitConverter.ToInt32( tmp, 0 ) ];

        for( int i = 0; i < stco.Table.Length; i++ )
        {
            tmp = br.ReadBytes( 4 ); Utility.LeReverse( tmp );
            stco.Table[ i ] = BitConverter.ToInt32( tmp, 0 );
        }

        this.data = stco;
    }