Archive for April, 2006

AMF3 reference deserializer in Java

Friday, April 28th, 2006

I’ve released some source code into the Public Domain, from my work in adding AMF3 deserialization support to Charles, as a reference for and compliment to the AMF3 specification.

The source code is a single Java file containing all of the AMF3 specific implementation. You can download it here as a zip file: AMF3Deserializer.zip.

UPDATE 6 May 2006: The reference implementation has been updated to include the newly discovered Undefined type and to correct the integer parsing (including negative integer parsing, credit to Martin Schnabel).

UPDATE 23 December 2006: Another update released here.

Charles on Monkey Bites

Tuesday, April 25th, 2006

Charles was reviewed yesterday on Monkey Bites, a blog on Wired.com. Thanks to Mark at Fluid for spreading the good word!

Charles v2.4 released with AMF 3 support

Monday, April 24th, 2006

This morning I’ve released version 2.4 of Charles including the AMF 3 support. This will enable early adopters of Flex 2 Beta to debug their Flex 2 applications. The AMF 3 implementation in Charles is based upon the AMF 3 spec from Kevin Langdon. There are several additional details that I’m hoping to add to the spec with this week.

This release of Charles also coincides with the addition of a Documentation Wiki for Charles and the beginnings of some proper documentation on the various features in Charles. I’ll be adding to and improving the documentation in the next few weeks.

AMF 3 support in Charles

Sunday, April 23rd, 2006

This weekend I’ve implemented AMF 3 support in Charles, with help from the AMF 3 spec from Kevin Langdon. AMF 3 is the next version of the AMF (Flash Remoting) protocol as used in the new Flex beta from Adobe.

The AMF 3 support in Charles is currently beta but will be released tomorrow with luck. There are bound to be bugs in the parsing as there isn’t a lot of AMF 3 around at the moment so please send feedback if you have successes or failures with it.

Patch for JDK 1.5 ZipFile to fix slow network drive access

Saturday, April 22nd, 2006

First published 7 September 2005.

There is a problem with java.util.ZipFile in JDK 1.5 that it is very slow to perform some operations when the ZIP/JAR file is on a network drive. See this bug report.

This patch is based on the source for ZipFile from JDK 1.5.0_04. It is intended for use on Windows only (but see Limitations). The download includes source, a compiled version of the patch and a Windows .BAT file for installing it.

The installation just involves adding the patched classes into your rt.jar file for your Java runtime environment.

Patch Detail

The patched java.util.ZipFile looks at the path of the zip/jar file when trying to open it. If it determines that the path is on a network drive it instead copies it to a location on your local drive and uses that copy instead. If the copy already exists it checks the timestamps to ensure it is up to date. Copies are stored in the temporary directory on your system as determined by System.getProperty("java.io.tmpdir").

This results in a massive speed-up for accessing zips/jars on network drives, and a small cache of zips/jars on your local drive.

In the source code the patch changes are all between the /* PATCH BEGINS */ and /* PATCH ENDS */ comments. The rest is the original code.

Limitations

The patch is written with Windows in mind, as it checks for C: at the start of the full path in order to determine whether the file is on a network drive or not! This obviously won’t work very well for other operating systems. It will be really easy to change the patch to suit those requirements though. The source is included in the download; if you do this please let me know so that I can add your efforts to this page.

Installation Instructions

You can download the patch here. There is a readme file in the ZIP.

Download Windows patch + source