MXFormat is a very useful class when you want to convert data between various MAXTYPES.
This class can be found in the package psdi.util.
There are many many many methods which can be used so you need not re-invent the wheel for some small stuff like conversion.
Have a look, Enjoy!!