     import flash.utils.Endian;    
     import flash.utils.IDataInput;
     import flash.utils.IDataOutput;
+    //import com.hurlant.util.Hex;
 
     /**
      * NALU processing utilities.

            sps.writeBytes(bytes, cursor, length);

            var ourEg:ExpGolomb = new ExpGolomb(sps);
            ourEg.readBits(16);
            var ourId:int = ourEg.readUE();

            // If not present in list add it!
            var found:Boolean = false;
            for(var i:int=0; i<spsList.length; i++)
            {
                // If it matches our ID, replace it.
                var eg:ExpGolomb = new ExpGolomb(spsList[i]);
                eg.readBits(16);
                var foundId:int = eg.readUE();

                if(foundId == ourId)
                {
                    //trace("Got SPS match for " + foundId + "!");
                    spsList[i] = sps;
                    return;
                }

                if(spsList[i].length != length)
                    continue;

                // If identical don't append to list.
                for(var j:int=0; j<spsList[i].length && j<sps.length; j++)
                    if(spsList[i][j] != sps[j])
                        continue;

                found = true;
                break;
            }

            // Maybe we do have to add it!
            if(!found)
                spsList.push(sps);
        }

        /**

            {
                var ppsLength:uint = ppsList[i].length;
                //trace("PPS length #" + i + " is " + ppsLength + "   " + Hex.fromArray(ppsList[i], true));

                eg = new ExpGolomb(ppsList[i]);
                // constraint_set[0-5]_flag, u(1), reserved_zero_2bits u(2), level_idc u(8)
                eg.readBits(8);
                //trace("Saw id " + eg.readUE());

                avcc.position = cursor;
                ppsList[i].position = 0;
                avcc.writeShort(ppsLength);
