var formatArr:Array=new Array();
for (var i:uint=0; i<10; i++)
{
formatArr.push(byteArray.readByte().toString(16).toLocaleUpperCase());
}
function getFormat(arr:Array):String
{
if (arr[0] == "66" && arr[1] == "77" && arr[2] == "54")
{
return "BMP";
}
else if ( arr[6] == "4A" && arr[7] == "46" && arr[8] == "49" && arr[9] == "46" )
{
return "JPEG";
}
else if ( arr[0] == "47" && arr[1] == "49" && arr[2] == "46" )
{
return "GIF";
}
else if ( arr[1] == "50" && arr[2] == "4E" && arr[3] == "47" )
{
return "PNG";
}
else if ( arr[0] == "49" && arr[1] == "49" && arr[4] == "4C" && arr[5] == "42" )
{
return "TIF";
}
else
{
return null;
}
}
for (var i:uint=0; i<10; i++)
{
formatArr.push(byteArray.readByte().toString(16).toLocaleUpperCase());
}
function getFormat(arr:Array):String
{
if (arr[0] == "66" && arr[1] == "77" && arr[2] == "54")
{
return "BMP";
}
else if ( arr[6] == "4A" && arr[7] == "46" && arr[8] == "49" && arr[9] == "46" )
{
return "JPEG";
}
else if ( arr[0] == "47" && arr[1] == "49" && arr[2] == "46" )
{
return "GIF";
}
else if ( arr[1] == "50" && arr[2] == "4E" && arr[3] == "47" )
{
return "PNG";
}
else if ( arr[0] == "49" && arr[1] == "49" && arr[4] == "4C" && arr[5] == "42" )
{
return "TIF";
}
else
{
return null;
}
}
鱼扑影视网:http://www.fishp.com