code: void write(ImmutableBean bean) throws IOException {
          // sets up the map of beans - classes & classSerializationCount
          references = BeanReferences.find(bean, settings);
  
          // write array of 4 items - Version, Ref Count, Class Info, Root Bean
          output.writeArrayHeader(4);
          output.writeInt(2);
          writeClassDescriptions(references);
          writeRootBean(bean, true);
      }
docs: writes the bean