function amf0decObject(buf) { // TODO: Implement references!
  let obj = {};
  let iBuf = buf.slice(1);
  let len = 1;
  //    logger.debug('ODec',iBuf.readUInt8(0));
  while (iBuf.readUInt8(0) != 0x09) {
    // logger.debug('Field', iBuf.readUInt8(0), iBuf);
    let prop = amf0decUString(iBuf);
    // logger.debug('Got field for property', prop);
    len += prop.len;
    if (iBuf.length < prop.len) {
      break;
    }
    if (iBuf.slice(prop.len).readUInt8(0) == 0x09) {
      len++;
      // logger.debug('Found the end property');
      break;
    } // END Object as value, we shall leave
    if (prop.value == "") break;
    let val = amf0DecodeOne(iBuf.slice(prop.len));
    // logger.debug('Got field for value', val);
    obj[prop.value] = val.value;
    len += val.len;
    iBuf = iBuf.slice(prop.len + val.len);
  }
  return { len: len, value: obj };
}
AMF0 Decode Object
@param {Buffer} buf
@returns {{len: number, value: {}}}