private static int writeSize(Annotations annotations) {
    // This includes an int size at the start of the list.

    try {
      return (annotations.size() * ENTRY_WRITE_SIZE) + 4;
    } catch (NullPointerException ex) {
      // Elucidate the exception.
      throw new NullPointerException("list == null");
    }
  }
Gets the write size for the given set.

@param annotations {@code non-null;} the set
@return {@code > 0;} the write size
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/AnnotationSetItem.java