code: public void close() {
          if (closed)
              return;
          if (source instanceof Closeable) {
              try {
                  ((Closeable)source).close();
              } catch (IOException ioe) {
                  lastException = ioe;
              }
          }
          sourceClosed = true;
          source = null;
          closed = true;
      }
docs: Closes this scanner.
  
  <p> If this scanner has not yet been closed then if its underlying
  {@linkplain java.lang.Readable readable} also implements the {@link
  java.io.Closeable} interface then the readable's <tt>close</tt> method
  will be invoked.  If this scanner is already closed then invoking this
  method will have no effect.
  
  <p>Attempting to perform search operations after a scanner has
  been closed will result in an {@link IllegalStateException}.