amfUtils.js
function amf3encXmlDoc(str) {
    var sLen = amf3encUI29(str.length << 1);
    var buf = new Buffer(1);
    buf.writeUInt8(0x7, 0);
    return Buffer.concat([buf, sLen, new Buffer(str, 'utf8')]);
}
function amf3encXmlDoc(str) {
    var sLen = amf3encUI29(str.length << 1);
    var buf = new Buffer(1);
    buf.writeUInt8(0x7, 0);
    return Buffer.concat([buf, sLen, new Buffer(str, 'utf8')]);
}
function amf3encXmlDoc ( str ) { var sLen = amf3encUI29 ( str . length << 1 ) ; var buf = new Buffer ( 1 ) ; buf . writeUInt8 ( 0x7 , 0 ) ; return Buffer . concat ( [ buf , sLen , new Buffer ( str , 'utf8' ) ] ) ; }
AMF3 Encode XMLDoc
@param str
@returns {Buffer}
AMF3 Encode XMLDoc