Author: toad
Date: 2008-02-09 12:47:05 +0000 (Sat, 09 Feb 2008)
New Revision: 17742
Modified:
trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java
Log:
Write the length of the chunk and the chunk type bytes a bit later on.
Modified: trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java
2008-02-09 12:44:02 UTC (rev 17741)
+++ trunk/freenet/src/freenet/clients/http/filter/PNGFilter.java
2008-02-09 12:47:05 UTC (rev 17742)
@@ -128,8 +128,6 @@
int length = ((lengthBytes[0] & 0xff) << 24) +
((lengthBytes[1] & 0xff) << 16) + ((lengthBytes[2] & 0xff) << 8) +
(lengthBytes[3] & 0xff);
if(logMINOR)
Logger.minor(this, "length " + length);
- if(dos != null)
- dos.write(lengthBytes);
// Type of the chunk : Should match [a-zA-Z]{4}
if(dis.read(lengthBytes) < 4)
@@ -144,8 +142,6 @@
} else
throw new IOException("The name
of the chunk is invalid!");
}
- if(dos != null)
- dos.write(chunkTypeBytes);
chunkTypeString = sb.toString();
if(logMINOR)
Logger.minor(this, "name " +
chunkTypeString);
@@ -161,6 +157,10 @@
else
Logger.minor(this, "data " +
chunkData.length);
if(dos != null)
+ dos.write(lengthBytes);
+ if(dos != null)
+ dos.write(chunkTypeBytes);
+ if(dos != null)
dos.write(chunkData);
// CRC of the chunk