public static < E > CloseableSpliterator < E > spliterator ( CloseableIterator < ? extends E > iterator , long size , int characteristics ) { return new CloseableIteratorAsCloseableSpliterator <> ( iterator , size , characteristics ) ; }
Takes a provided closeable iterator and wraps it appropriately so it can be used as a closeable spliterator that will close the iterator when the spliterator is closed .