<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Lightweight SWF Header Reader (Java) II</title>
	<atom:link href="http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/</link>
	<description>This is the blog of Brooks Andrus. Here, at irregular intervals, you may find digital noise centered around the activities of an early 21st century technologist. I work for TechSmith Corporation, but this web space and the views found on it are entirely my own.</description>
	<lastBuildDate>Wed, 08 May 2013 11:05:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: ToescaC</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-52928</link>
		<dc:creator>ToescaC</dc:creator>
		<pubDate>Mon, 17 Dec 2012 13:54:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-52928</guid>
		<description><![CDATA[Thanks for this component, very usefull.
I&#039;ve noticed un bug with somes swf, where the &quot;SWFDecompressor.java.uncompress&quot; function enter in a infinite loop.

To correct this problem, I&#039;ve replaced the code:

while ( !decompressor.finished())
      {
         try
         {
            int count = decompressor.inflate( buffer );//decompress the data into the buffer
            stream.write(buffer, 0, count );
         }
         catch( DataFormatException dfe )
         {
            dfe.printStackTrace();
         }
      }

By this one:


int count = 1;
while ( !decompressor.finished()&amp;&amp; (count&gt;0) )
{
         try
         {
            count = decompressor.inflate( buffer );//decompress the data into the buffer
            stream.write(buffer, 0, count );
         }
         catch( DataFormatException dfe )
         {
            dfe.printStackTrace();
         }
}]]></description>
		<content:encoded><![CDATA[<p>Thanks for this component, very usefull.<br />
I&#8217;ve noticed un bug with somes swf, where the &#8220;SWFDecompressor.java.uncompress&#8221; function enter in a infinite loop.</p>
<p>To correct this problem, I&#8217;ve replaced the code:</p>
<p>while ( !decompressor.finished())<br />
      {<br />
         try<br />
         {<br />
            int count = decompressor.inflate( buffer );//decompress the data into the buffer<br />
            stream.write(buffer, 0, count );<br />
         }<br />
         catch( DataFormatException dfe )<br />
         {<br />
            dfe.printStackTrace();<br />
         }<br />
      }</p>
<p>By this one:</p>
<p>int count = 1;<br />
while ( !decompressor.finished()&amp;&amp; (count&gt;0) )<br />
{<br />
         try<br />
         {<br />
            count = decompressor.inflate( buffer );//decompress the data into the buffer<br />
            stream.write(buffer, 0, count );<br />
         }<br />
         catch( DataFormatException dfe )<br />
         {<br />
            dfe.printStackTrace();<br />
         }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cvg</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-52653</link>
		<dc:creator>cvg</dc:creator>
		<pubDate>Wed, 30 Nov 2011 19:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-52653</guid>
		<description><![CDATA[very neat :)
thanks]]></description>
		<content:encoded><![CDATA[<p>very neat :)<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anon</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-52483</link>
		<dc:creator>Anon</dc:creator>
		<pubDate>Tue, 01 Mar 2011 19:43:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-52483</guid>
		<description><![CDATA[thx!]]></description>
		<content:encoded><![CDATA[<p>thx!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ferrero DBGM</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-50104</link>
		<dc:creator>Ferrero DBGM</dc:creator>
		<pubDate>Tue, 02 Feb 2010 20:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-50104</guid>
		<description><![CDATA[Thank you!! :)]]></description>
		<content:encoded><![CDATA[<p>Thank you!! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pall Zoltan</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-50051</link>
		<dc:creator>Pall Zoltan</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-50051</guid>
		<description><![CDATA[sweet sweet code, thank you! i&#039;m porting SWFHeader to AS3, it can be very useful at runtime :)

cheers,
Z.]]></description>
		<content:encoded><![CDATA[<p>sweet sweet code, thank you! i&#8217;m porting SWFHeader to AS3, it can be very useful at runtime :)</p>
<p>cheers,<br />
Z.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BateRiste</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-49863</link>
		<dc:creator>BateRiste</dc:creator>
		<pubDate>Tue, 28 Apr 2009 17:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-49863</guid>
		<description><![CDATA[It seems that the jar file won&#039;t work on Java 1.4?]]></description>
		<content:encoded><![CDATA[<p>It seems that the jar file won&#8217;t work on Java 1.4?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-48861</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Tue, 21 Oct 2008 10:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-48861</guid>
		<description><![CDATA[Hi there,

this is already a litte old here, but I try.... you mentioned above that you are intrested in reading/writing meta data into the flash,... well I wonder if you ever managed to actually to do that ?!]]></description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>this is already a litte old here, but I try&#8230;. you mentioned above that you are intrested in reading/writing meta data into the flash,&#8230; well I wonder if you ever managed to actually to do that ?!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-19585</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 11 Sep 2007 04:08:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-19585</guid>
		<description><![CDATA[The SWFHeader.java is not matching the classes in swfheader.jar. In SWFHeader.java it extends SWFCompression, but in the jar there is no SWFCompression, and SWFHeader doesn&#039;t extends SWFCompression. Is the jar the latest one? It would be nice if you could post the current code. 
The jar version is also printing some debug info to the output.
Also in both version an IOException it prints to standard error instead of throwing an exception, and at least the source code does the same when it finds an invalid file, and having the code I can just add this improvements.]]></description>
		<content:encoded><![CDATA[<p>The SWFHeader.java is not matching the classes in swfheader.jar. In SWFHeader.java it extends SWFCompression, but in the jar there is no SWFCompression, and SWFHeader doesn&#8217;t extends SWFCompression. Is the jar the latest one? It would be nice if you could post the current code.<br />
The jar version is also printing some debug info to the output.<br />
Also in both version an IOException it prints to standard error instead of throwing an exception, and at least the source code does the same when it finds an invalid file, and having the code I can just add this improvements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-14066</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Fri, 27 Jul 2007 17:15:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-14066</guid>
		<description><![CDATA[Hello Andrus!
I tested your useful code with 2 swf files of v.5 and v.7.
It works correct for v.5

But for v.7 of SWF, getWidth and getHeight return wrong values
Those values are double converted from twips.
In the same time maxX and maxY contain correct size in pixels(!)]]></description>
		<content:encoded><![CDATA[<p>Hello Andrus!<br />
I tested your useful code with 2 swf files of v.5 and v.7.<br />
It works correct for v.5</p>
<p>But for v.7 of SWF, getWidth and getHeight return wrong values<br />
Those values are double converted from twips.<br />
In the same time maxX and maxY contain correct size in pixels(!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brooks</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-7673</link>
		<dc:creator>Brooks</dc:creator>
		<pubDate>Sat, 24 Mar 2007 14:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-7673</guid>
		<description><![CDATA[Yep, I noticed that bug regarding frame count awhile ago and fixed, but I apparently forgot to upload the files. I&#039;ve now checked to make sure that the header reader accurately reads the number of frames up to the swf file format imposed limit of 16000. The files on the website have been updated accordingly.]]></description>
		<content:encoded><![CDATA[<p>Yep, I noticed that bug regarding frame count awhile ago and fixed, but I apparently forgot to upload the files. I&#8217;ve now checked to make sure that the header reader accurately reads the number of frames up to the swf file format imposed limit of 16000. The files on the website have been updated accordingly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sale gosse</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-7672</link>
		<dc:creator>sale gosse</dc:creator>
		<pubDate>Sat, 24 Mar 2007 14:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-7672</guid>
		<description><![CDATA[It seems to be ok by remplacing

frameCount = ( frameCount  127 for the second swf[bytePointer] lead to the problem.]]></description>
		<content:encoded><![CDATA[<p>It seems to be ok by remplacing</p>
<p>frameCount = ( frameCount  127 for the second swf[bytePointer] lead to the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sale gosse</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-7670</link>
		<dc:creator>sale gosse</dc:creator>
		<pubDate>Sat, 24 Mar 2007 13:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-7670</guid>
		<description><![CDATA[Ooops, the problem is
swf.getFrameCount() is ]]></description>
		<content:encoded><![CDATA[<p>Ooops, the problem is<br />
swf.getFrameCount() is </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sale gosse</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-7669</link>
		<dc:creator>sale gosse</dc:creator>
		<pubDate>Sat, 24 Mar 2007 13:46:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-7669</guid>
		<description><![CDATA[doesnt work with that one
&lt;em&gt;[link removed]&lt;/em&gt;
(I know, this is disgusting but i&#039;m serious)]]></description>
		<content:encoded><![CDATA[<p>doesnt work with that one<br />
<em>[link removed]</em><br />
(I know, this is disgusting but i&#8217;m serious)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OrtOfOn</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-1465</link>
		<dc:creator>OrtOfOn</dc:creator>
		<pubDate>Wed, 18 Oct 2006 09:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-1465</guid>
		<description><![CDATA[Very Cool, thx Brooks !!!

OrtOfOn]]></description>
		<content:encoded><![CDATA[<p>Very Cool, thx Brooks !!!</p>
<p>OrtOfOn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brooks</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-1454</link>
		<dc:creator>Brooks</dc:creator>
		<pubDate>Tue, 17 Oct 2006 14:25:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-1454</guid>
		<description><![CDATA[Yep, I&#039;m aware of that bug and have fixed. I updated the source files on the Web page, but I must not of updated the jar. The issue was the result of using an arbitrary byte position when reading in the packed bit &quot;rectangle&quot; construct the swf format uses.

I&#039;ll compile a new jar, test and post an update.

Brooks]]></description>
		<content:encoded><![CDATA[<p>Yep, I&#8217;m aware of that bug and have fixed. I updated the source files on the Web page, but I must not of updated the jar. The issue was the result of using an arbitrary byte position when reading in the packed bit &#8220;rectangle&#8221; construct the swf format uses.</p>
<p>I&#8217;ll compile a new jar, test and post an update.</p>
<p>Brooks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OrtOfOn</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-1453</link>
		<dc:creator>OrtOfOn</dc:creator>
		<pubDate>Tue, 17 Oct 2006 13:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-1453</guid>
		<description><![CDATA[Sorry.... little mistake in my first comment...

The bug appears when youâ€™re trying to get info from an SWF bigger than 819 in width or height.


819 is the limit size of the stage to make the swfheader working.


Thx.]]></description>
		<content:encoded><![CDATA[<p>Sorry&#8230;. little mistake in my first comment&#8230;</p>
<p>The bug appears when youâ€™re trying to get info from an SWF bigger than 819 in width or height.</p>
<p>819 is the limit size of the stage to make the swfheader working.</p>
<p>Thx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OrtOfOn</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-1452</link>
		<dc:creator>OrtOfOn</dc:creator>
		<pubDate>Tue, 17 Oct 2006 13:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-1452</guid>
		<description><![CDATA[Hello andrus,

I was very happy when you made a JAR version of this tool but I found a bug and I&#039;m not so good with bitwise operators then it&#039;s difficult for me to fix it.

The bug appears when you&#039;re trying to get info from an SWF bigger than 810 in width or height.

Do you know why ?

Thx in advance.


OrtOfOn]]></description>
		<content:encoded><![CDATA[<p>Hello andrus,</p>
<p>I was very happy when you made a JAR version of this tool but I found a bug and I&#8217;m not so good with bitwise operators then it&#8217;s difficult for me to fix it.</p>
<p>The bug appears when you&#8217;re trying to get info from an SWF bigger than 810 in width or height.</p>
<p>Do you know why ?</p>
<p>Thx in advance.</p>
<p>OrtOfOn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anson Chiew</title>
		<link>http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/comment-page-1/#comment-1416</link>
		<dc:creator>Anson Chiew</dc:creator>
		<pubDate>Fri, 13 Oct 2006 09:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2006/08/11/lightweight-swf-header-reader-java-ii/#comment-1416</guid>
		<description><![CDATA[As the implementation of unsigned right shift in Java is not as expected, your parseHeader() does not work for all flash files. To fix the problem, simply change the following line

nbits = ( rect[0] &gt;&gt;&gt; 3 );

to

nbits =  (rect[0] &amp; 0xff) &gt;&gt; 3;

For more details:
http://www.cs.utsa.edu/~wagner/laws/Abytes.html]]></description>
		<content:encoded><![CDATA[<p>As the implementation of unsigned right shift in Java is not as expected, your parseHeader() does not work for all flash files. To fix the problem, simply change the following line</p>
<p>nbits = ( rect[0] &gt;&gt;&gt; 3 );</p>
<p>to</p>
<p>nbits =  (rect[0] &amp; 0xff) &gt;&gt; 3;</p>
<p>For more details:<br />
<a href="http://www.cs.utsa.edu/~wagner/laws/Abytes.html" rel="nofollow">http://www.cs.utsa.edu/~wagner/laws/Abytes.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
