code: public int metadataSize() {
          if (invalid) {
              return -1;
          }
  
          if (size > 0) {
              return size;
          }
  
          sync.lock();
  
          try {
              if (invalid) {
                  return -1;
              }
  
              if (size > 0) {
                  return size;
              }
  
              torrent_handle th = alert.getHandle();
              if (th == null || !th.is_valid()) {
                  invalid = true;
                  return -1;
              }
  
              torrent_info ti = th.torrent_file_ptr();
              if (ti == null || !ti.is_valid()) {
                  invalid = true;
                  return -1;
              }
  
              size = ti.metadata_size();
  
          } catch (Throwable e) {
              invalid = true;
          } finally {
              sync.unlock();
          }
  
          return size;
      }
docs: Returns the size of the metadata (info section).
  <p>
  Internally it uses a lock synchronization to make it thread-safe.
  
  @return the metadata size