Encoding / decoding for Adobe Action Message Format (AMF0 and AMF3)