code: public void writeObject(Object object) throws IOException {
          if (encoding == ObjectEncoding.AMF3) {
              encodeAmf3(object); // Skip AMF0 -> AMF3 marker
          } else {
              encodeAmf0(object);
          }
      }
docs: </editor-fold>