code: public static <S extends Closeable> void closeOnComplete(S stream, StreamTask<S> task) {
          closeOnComplete(stream, task, DEFAULT_ERROR_HANDLER);
      }
docs: Helper method to run a specified task and automatically handle the closing of the stream.
  
  @param stream
  @param task