public final int setFileOffset(int fileOffset) {
    if (fileOffset < 0) {
      throw new IllegalArgumentException("fileOffset < 0");
    }

    if (this.fileOffset >= 0) {
      throw new RuntimeException("fileOffset already set");
    }

    int mask = alignment - 1;
    fileOffset = (fileOffset + mask) & ~mask;

    this.fileOffset = fileOffset;

    return fileOffset;
  }
Sets the file offset. It is only valid to call this method once once per instance.

@param fileOffset {@code >= 0;} the desired offset from the start of the file where this for
    this instance
@return {@code >= 0;} the offset that this instance should be placed at in order to meet its
    alignment constraint
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/Section.java