Uses of Interface
java.util.stream.Stream
Packages that useStream
Package
Description
Provides for system input and output through data streams, serialization and the file system.
Provides classes that are fundamental to the design of the Java programming language.
Classes to support module descriptors and creating configurations of modules by means of resolution and service binding.
Provides the classes for implementing networking applications.
HTTP Client and WebSocket APIs
Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.
Provides the classes and interfaces for the security framework.
Provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java programming language.
The main API for dates, times, instants, and durations.
Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.
Provides classes for reading and writing the JAR (Java ARchive) file format, which is based on the standard ZIP file format with an optional manifest file.
This package contains classes and interfaces that support a generic API for random number generation.
Classes for matching character sequences against patterns specified by regular expressions.
Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.
Provides classes for reading and writing the standard ZIP and GZIP file formats.
Provides the classes for implementing XML Catalogs OASIS Standard V1.1, 7 October 2005.
Classes to support low-level and efficient foreign memory/function access, directly from Java.
Provides interfaces for creating tools, such as a Read-Eval-Print Loop (REPL), which interactively evaluate "snippets" of Java programming language code.
Uses ofStream injava.io
Uses ofStream injava.lang
Modifier and TypeMethodDescriptionstaticStream<ProcessHandle>ProcessHandle.allProcesses()Returns a snapshot of all processes visible to the current process.Process.children()Returns a snapshot of the direct children of the process.ProcessHandle.children()Returns a snapshot of the current direct children of the process.Process.descendants()Returns a snapshot of the descendants of the process.ProcessHandle.descendants()Returns a snapshot of the descendants of the process.String.lines()Returns a stream of lines extracted from this string, separated by line terminators.Returns a stream whose elements are the URLs of all the resources with the given name.Modifier and TypeMethodDescription<T> TStackWalker.walk(Function<? superStream<StackWalker.StackFrame>, ? extends T> function) Applies the given function to the stream ofStackFrames for the current thread, traversing from the top frame of the stack, which is the method calling thiswalkmethod.Uses ofStream injava.lang.module
Methods injava.lang.module that returnStreamUses ofStream injava.net
Modifier and TypeMethodDescriptionNetworkInterface.inetAddresses()Get a Stream of all or a subset of the InetAddresses bound to this network interface.staticStream<NetworkInterface>NetworkInterface.networkInterfaces()Returns aStreamof all the interfaces on this machine.NetworkInterface.subInterfaces()Get a Stream of all subinterfaces (also known as virtual interfaces) attached to this network interface.Uses ofStream injava.net.http
Methods injava.net.http that return types with arguments of typeStreamModifier and TypeMethodDescriptionstaticHttpResponse.BodyHandler<Stream<String>>HttpResponse.BodyHandlers.ofLines()Returns aBodyHandler<Stream<String>>that returns aBodySubscriber<Stream<String>>obtained fromBodySubscribers.ofLines(charset).staticHttpResponse.BodySubscriber<Stream<String>>Returns aBodySubscriberwhich streams the response body as aStream<String>, where each string in the stream corresponds to a line as defined byBufferedReader.lines().Uses ofStream injava.nio.file
Methods injava.nio.file that returnStreamModifier and TypeMethodDescriptionFiles.find(Path start, int maxDepth,BiPredicate<Path, BasicFileAttributes> matcher,FileVisitOption... options) Return aStreamthat is lazily populated withPathby searching for files in a file tree rooted at a given starting file.Read all lines from a file as aStream.Read all lines from a file as aStream.Return a lazily populatedStream, the elements of which are the entries in the directory.Files.walk(Path start, int maxDepth,FileVisitOption... options) Return aStreamthat is lazily populated withPathby walking the file tree rooted at a given starting file.Files.walk(Path start,FileVisitOption... options) Return aStreamthat is lazily populated withPathby walking the file tree rooted at a given starting file.Uses ofStream injava.security
Methods injava.security that returnStreamModifier and TypeMethodDescriptionPermissionCollection.elementsAsStream()Returns a stream of all the Permission objects in the collection.Uses ofStream injava.sql
Uses ofStream injava.time
Modifier and TypeMethodDescriptionLocalDate.datesUntil(LocalDate endExclusive) Returns a sequential ordered stream of dates.LocalDate.datesUntil(LocalDate endExclusive,Period step) Returns a sequential ordered stream of dates by given incremental step.Uses ofStream injava.util
Modifier and TypeMethodDescriptionReturns a stream of match results that match the provided pattern string.Returns a stream of match results from this scanner.Collection.parallelStream()Returns a possibly parallelStreamwith this collection as its source.SplittableRandom.splits()Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.SplittableRandom.splits(long streamSize) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.SplittableRandom.splits(long streamSize,RandomGenerator.SplittableGenerator source) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.SplittableRandom.splits(RandomGenerator.SplittableGenerator source) Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.static <T> Stream<T>Arrays.stream(T[] array) Returns a sequentialStreamwith the specified array as its source.static <T> Stream<T>Arrays.stream(T[] array, int startInclusive, int endExclusive) Returns a sequentialStreamwith the specified range of the specified array as its source.Collection.stream()Returns a sequentialStreamwith this collection as its source.Optional.stream()If a value is present, returns a sequentialStreamcontaining only that value, otherwise returns an emptyStream.ServiceLoader.stream()Returns a stream to lazily load available providers of this loader's service.Scanner.tokens()Returns a stream of delimiter-separated tokens from this scanner.Uses ofStream injava.util.jar
Methods injava.util.jar that returnStreamUses ofStream injava.util.random
Methods injava.util.random that returnStreamModifier and TypeMethodDescriptionRandomGeneratorFactory.all()Returns a non-empty stream of availableRandomGeneratorFactory(s).RandomGenerator.ArbitrarilyJumpableGenerator.jumps(double distance) Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGenerator.ArbitrarilyJumpableGeneratorinterface, produced by jumping copies of this generator by different integer multiples of the specified jump distance.RandomGenerator.ArbitrarilyJumpableGenerator.jumps(long streamSize, double distance) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGenerator.ArbitrarilyJumpableGeneratorinterface, produced by jumping copies of this generator by different integer multiples of the specified jump distance.defaultStream<RandomGenerator>RandomGenerator.JumpableGenerator.jumps()Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGeneratorinterface.defaultStream<RandomGenerator>RandomGenerator.JumpableGenerator.jumps(long streamSize) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGeneratorinterface.RandomGenerator.LeapableGenerator.leaps()Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGenerator.JumpableGeneratorinterface.RandomGenerator.LeapableGenerator.leaps(long streamSize) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGenerator.JumpableGeneratorinterface.defaultStream<RandomGenerator>RandomGenerator.JumpableGenerator.rngs()Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGeneratorinterface.defaultStream<RandomGenerator>RandomGenerator.JumpableGenerator.rngs(long streamSize) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGeneratorinterface.defaultStream<RandomGenerator>RandomGenerator.SplittableGenerator.rngs()Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGeneratorinterface.defaultStream<RandomGenerator>RandomGenerator.SplittableGenerator.rngs(long streamSize) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGeneratorinterface.RandomGenerator.StreamableGenerator.rngs()Returns an effectively unlimited stream of objects, each of which implements theRandomGeneratorinterface.defaultStream<RandomGenerator>RandomGenerator.StreamableGenerator.rngs(long streamSize) Returns an effectively unlimited stream of objects, each of which implements theRandomGeneratorinterface.RandomGenerator.SplittableGenerator.splits()Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.RandomGenerator.SplittableGenerator.splits(long streamSize) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.RandomGenerator.SplittableGenerator.splits(long streamSize,RandomGenerator.SplittableGenerator source) Returns a stream producing the givenstreamSizenumber of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.RandomGenerator.SplittableGenerator.splits(RandomGenerator.SplittableGenerator source) Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements theRandomGenerator.SplittableGeneratorinterface.Uses ofStream injava.util.regex
Methods injava.util.regex that returnStreamModifier and TypeMethodDescriptionMatcher.results()Returns a stream of match results for each subsequence of the input sequence that matches the pattern.Pattern.splitAsStream(CharSequence input) Creates a stream from the given input sequence around matches of this pattern.Uses ofStream injava.util.stream
Methods injava.util.stream that returnStreamModifier and TypeMethodDescriptionDoubleStream.boxed()Returns aStreamconsisting of the elements of this stream, boxed toDouble.IntStream.boxed()Returns aStreamconsisting of the elements of this stream, each boxed to anInteger.LongStream.boxed()Returns aStreamconsisting of the elements of this stream, each boxed to aLong.Stream.Builder.build()Builds the stream, transitioning this builder to the built state.static <T> Stream<T>Creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream.Stream.distinct()Returns a stream consisting of the distinct elements (according toObject.equals(Object)) of this stream.Returns, if this stream is ordered, a stream consisting of the remaining elements of this stream after dropping the longest prefix of elements that match the given predicate.static <T> Stream<T>Stream.empty()Returns an empty sequentialStream.Returns a stream consisting of the elements of this stream that match the given predicate.<R> Stream<R>Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.static <T> Stream<T>Returns an infinite sequential unordered stream where each element is generated by the providedSupplier.static <T> Stream<T>Stream.iterate(T seed,Predicate<? super T> hasNext,UnaryOperator<T> next) Returns a sequential orderedStreamproduced by iterative application of the givennextfunction to an initial element, conditioned on satisfying the givenhasNextpredicate.static <T> Stream<T>Stream.iterate(T seed,UnaryOperator<T> f) Returns an infinite sequential orderedStreamproduced by iterative application of a functionfto an initial elementseed, producing aStreamconsisting ofseed,f(seed),f(f(seed)), etc.Stream.limit(long maxSize) Returns a stream consisting of the elements of this stream, truncated to be no longer thanmaxSizein length.<R> Stream<R>Returns a stream consisting of the results of applying the given function to the elements of this stream.default <R> Stream<R>Stream.mapMulti(BiConsumer<? superT, ? superConsumer<R>> mapper) Returns a stream consisting of the results of replacing each element of this stream with multiple elements, specifically zero or more elements.<U> Stream<U>DoubleStream.mapToObj(DoubleFunction<? extends U> mapper) Returns an object-valuedStreamconsisting of the results of applying the given function to the elements of this stream.<U> Stream<U>IntStream.mapToObj(IntFunction<? extends U> mapper) Returns an object-valuedStreamconsisting of the results of applying the given function to the elements of this stream.<U> Stream<U>LongStream.mapToObj(LongFunction<? extends U> mapper) Returns an object-valuedStreamconsisting of the results of applying the given function to the elements of this stream.static <T> Stream<T>Stream.of(T t) Returns a sequentialStreamcontaining a single element.static <T> Stream<T>Stream.of(T... values) Returns a sequential ordered stream whose elements are the specified values.static <T> Stream<T>Stream.ofNullable(T t) Returns a sequentialStreamcontaining a single element, if non-null, otherwise returns an emptyStream.Returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream.Stream.skip(long n) Returns a stream consisting of the remaining elements of this stream after discarding the firstnelements of the stream.Stream.sorted()Returns a stream consisting of the elements of this stream, sorted according to natural order.Stream.sorted(Comparator<? superT> comparator) Returns a stream consisting of the elements of this stream, sorted according to the providedComparator.static <T> Stream<T>StreamSupport.stream(Supplier<? extendsSpliterator<T>> supplier, int characteristics, boolean parallel) Creates a new sequential or parallelStreamfrom aSupplierofSpliterator.static <T> Stream<T>StreamSupport.stream(Spliterator<T> spliterator, boolean parallel) Creates a new sequential or parallelStreamfrom aSpliterator.Returns, if this stream is ordered, a stream consisting of the longest prefix of elements taken from this stream that match the given predicate.Methods injava.util.stream with parameters of typeStreamModifier and TypeMethodDescriptionstatic <T> Stream<T>Creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream.Method parameters injava.util.stream with type arguments of typeStreamModifier and TypeMethodDescription<R> Stream<R>Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.static <T,U, A, R> Collector<T, ?, R> Collectors.flatMapping(Function<? super T, ? extendsStream<? extends U>> mapper,Collector<? super U, A, R> downstream) Adapts aCollectoraccepting elements of typeUto one accepting elements of typeTby applying a flat mapping function to each input element before accumulation.Uses ofStream injava.util.zip
Methods injava.util.zip that returnStreamUses ofStream injavax.xml.catalog
Methods injavax.xml.catalog that returnStreamModifier and TypeMethodDescriptionCatalog.catalogs()Returns a sequential Stream of alternative Catalogs specified using thenextCatalogentries in the current catalog, and as the input of catalog files excluding the current catalog (that is, the first in the input list) when the Catalog object is created by theCatalogManager.Uses ofStream injdk.incubator.foreign
Methods injdk.incubator.foreign that returnStreamModifier and TypeMethodDescriptionFunctionDescriptor.attributes()Returns a stream of the attribute names associated with this function descriptor.MemoryLayout.attributes()Returns a stream of the attribute names associated with this layout.MemorySegment.elements(MemoryLayout elementLayout) Returns a sequentialStreamover disjoint slices (whose size matches that of the specified layout) in this segment.Uses ofStream injdk.jshell
Methods injdk.jshell that returnStreamModifier and TypeMethodDescriptionJShell.diagnostics(Snippet snippet) Return the diagnostics of the most recent evaluation of the snippet.JShell.imports()Returns the active import snippets.JShell.methods()Returns the active method snippets.JShell.snippets()Return all snippets.JShell.types()Returns the active type declaration (class, interface, annotation type, and enum) snippets.JShell.unresolvedDependencies(DeclarationSnippet snippet) ForRECOVERABLE_DEFINEDorRECOVERABLE_NOT_DEFINEDdeclarations, the names of current unresolved dependencies for the snippet.JShell.variables()Returns the active variable snippets.