Exemple #1
0
        private void ReadChunk(AByteArray aByteArray)
        {
            string lId = aByteArray.ReadString(4);

            UInt32 lSize = aByteArray.ReadUInt32();

            int lPositionStart = aByteArray.Position;

            // Check Padding.
            if (lSize % 2 == 1)
            {
                if (lPositionStart + lSize <= aByteArray.Length && aByteArray.ReadByte(( int )(lPositionStart + lSize)) == 0x00)
                {
                    lSize++;

                    Logger.Debug("Padding:" + lSize);
                }
                else
                {
                    Logger.Debug("No Padding:" + lSize);
                }

                aByteArray.SetPosition(lPositionStart);
            }

            FormChunk lRiffWave = Construct(lId, lSize, aByteArray, this);

            chunkList.Add(lRiffWave);

            if (aByteArray.Position != lPositionStart + lSize)
            {
                Logger.Debug("Modify Position:" + aByteArray.Position + "->" + (lPositionStart + lSize));
                aByteArray.SetPosition(( int )(lPositionStart + lSize));
            }
        }
Exemple #2
0
        protected void OverrideChunk(FormChunk aChunk)
        {
            for (int i = 0; i < chunkList.Count; i++)
            {
                if (chunkList[i].id == aChunk.id)
                {
                    chunkList[i] = aChunk;

                    return;
                }
            }
        }
Exemple #3
0
 protected void AddChunk(FormChunk aRiffWave)
 {
     chunkList.Add(aRiffWave);
 }