code: public static void close(FileDescriptor fd) throws IOException {
          try {
              if (fd != null && fd.valid()) {
                  Libcore.os.close(fd);
              }
          } catch (ErrnoException errnoException) {
              throw errnoException.rethrowAsIOException();
          }
      }
docs: Calls close(2) on 'fd'. Also resets the internal int to -1. Does nothing if 'fd' is null
  or invalid.