public byte[] toDex(Writer humanOut, boolean verbose) throws IOException {
    boolean annotate = (humanOut != null);
    ByteArrayAnnotatedOutput result = toDex0(annotate, verbose, null);

    if (annotate) {
      result.writeAnnotationsTo(humanOut);
    }

    return result.getArray();
  }
Returns the contents of this instance as a {@code .dex} file, in {@code byte[]} form.

@param humanOut {@code null-ok;} where to write human-oriented output to
@param verbose whether to be verbose when writing human-oriented output
@return {@code non-null;} a {@code .dex} file for this instance
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/DexFile.java