amfUtils.js
function amf0encArray(a) {
    var l = 0;
    if (a instanceof Array) l = a.length; else l = Object.keys(a).length;
    console.log('Array encode', l, a);
    var buf = new Buffer(5);
    buf.writeUInt8(8,0);
    buf.writeUInt32BE(l,1);
    var data = amf0encObject(a);
    return Buffer.concat([buf,data.slice(1)]);
}
function amf0encArray(a) {
    var l = 0;
    if (a instanceof Array) l = a.length; else l = Object.keys(a).length;
    console.log('Array encode', l, a);
    var buf = new Buffer(5);
    buf.writeUInt8(8,0);
    buf.writeUInt32BE(l,1);
    var data = amf0encObject(a);
    return Buffer.concat([buf,data.slice(1)]);
}
function amf0encArray ( a ) { var l = 0 ; if ( a instanceof Array ) l = a . length ; else l = Object . keys ( a ) . length ; console . log ( 'Array encode' , l , a ) ; var buf = new Buffer ( 5 ) ; buf . writeUInt8 ( 8 , 0 ) ; buf . writeUInt32BE ( l , 1 ) ; var data = amf0encObject ( a ) ; return Buffer . concat ( [ buf , data . slice ( 1 ) ] ) ; }
AMF0 Encode Array
AMF0 Encode Array