private void encodeOutput(DexFile file, AnnotatedOutput out) {
    boolean annotates = out.annotates();

    if (annotates) {
      out.annotate(0, offsetString() + " class data for " + thisClass.toHuman());
    }

    encodeSize(file, out, "static_fields", staticFields.size());
    encodeSize(file, out, "instance_fields", instanceFields.size());
    encodeSize(file, out, "direct_methods", directMethods.size());
    encodeSize(file, out, "virtual_methods", virtualMethods.size());

    encodeList(file, out, "static_fields", staticFields);
    encodeList(file, out, "instance_fields", instanceFields);
    encodeList(file, out, "direct_methods", directMethods);
    encodeList(file, out, "virtual_methods", virtualMethods);

    if (annotates) {
      out.endAnnotation();
    }
  }
Writes out the encoded form of this instance.

@param file {@code non-null;} file this instance is part of
@param out {@code non-null;} where to write to
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/ClassDataItem.java