amfUtils.js
function amf0encString(str) {
    var buf = new Buffer(3);
    buf.writeUInt8(0x02, 0);
    buf.writeUInt16BE(str.length, 1);
    return Buffer.concat([buf, new Buffer(str, 'utf8')]);
}
function amf0encString(str) {
    var buf = new Buffer(3);
    buf.writeUInt8(0x02, 0);
    buf.writeUInt16BE(str.length, 1);
    return Buffer.concat([buf, new Buffer(str, 'utf8')]);
}
function amf0encString ( str ) { var buf = new Buffer ( 3 ) ; buf . writeUInt8 ( 0x02 , 0 ) ; buf . writeUInt16BE ( str . length , 1 ) ; return Buffer . concat ( [ buf , new Buffer ( str , 'utf8' ) ] ) ; }
AMF0 Encode String
@param str
@returns {Buffer}
AMF0 Encode String