package kotlin.streams.jdk8; import androidx.exifinterface.media.ExifInterface; import java.util.Iterator; import java.util.List; import java.util.Spliterator; import java.util.Spliterators; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.DoubleStream; import java.util.stream.IntStream; import java.util.stream.LongStream; import java.util.stream.Stream; import java.util.stream.StreamSupport; import kotlin.Metadata; import kotlin.collections.ArraysKt; import kotlin.jvm.internal.Intrinsics; import kotlin.sequences.Sequence; /* compiled from: Streams.kt */ @Metadata(d1 = {"\u0000.\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0006\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\u0010\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0000\u001a\u0012\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001*\u00020\u0003H\u0007\u001a\u0012\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00040\u0001*\u00020\u0005H\u0007\u001a\u0012\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00060\u0001*\u00020\u0007H\u0007\u001a\u001e\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\b0\u0001\"\u0004\b\u0000\u0010\b*\b\u0012\u0004\u0012\u0002H\b0\tH\u0007\u001a\u001e\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\b0\t\"\u0004\b\u0000\u0010\b*\b\u0012\u0004\u0012\u0002H\b0\u0001H\u0007\u001a\u0012\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00020\f*\u00020\u0003H\u0007\u001a\u0012\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00040\f*\u00020\u0005H\u0007\u001a\u0012\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00060\f*\u00020\u0007H\u0007\u001a\u001e\u0010\u000b\u001a\b\u0012\u0004\u0012\u0002H\b0\f\"\u0004\b\u0000\u0010\b*\b\u0012\u0004\u0012\u0002H\b0\tH\u0007ยจ\u0006\r"}, d2 = {"asSequence", "Lkotlin/sequences/Sequence;", "", "Ljava/util/stream/DoubleStream;", "", "Ljava/util/stream/IntStream;", "", "Ljava/util/stream/LongStream;", ExifInterface.GPS_DIRECTION_TRUE, "Ljava/util/stream/Stream;", "asStream", "toList", "", "kotlin-stdlib-jdk8"}, k = 2, mv = {1, 9, 0}, pn = "kotlin.streams", xi = 48) /* loaded from: classes3.dex */ public final class StreamsKt { public static final Sequence asSequence(final Stream stream) { Intrinsics.checkNotNullParameter(stream, ""); return new Sequence() { // from class: kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$1 @Override // kotlin.sequences.Sequence public Iterator iterator() { Iterator it = stream.iterator(); Intrinsics.checkNotNullExpressionValue(it, "iterator(...)"); return it; } }; } public static final Sequence asSequence(final IntStream intStream) { Intrinsics.checkNotNullParameter(intStream, ""); return new Sequence() { // from class: kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$2 @Override // kotlin.sequences.Sequence public Iterator iterator() { Iterator it = intStream.iterator(); Intrinsics.checkNotNullExpressionValue(it, "iterator(...)"); return it; } }; } public static final Sequence asSequence(final LongStream longStream) { Intrinsics.checkNotNullParameter(longStream, ""); return new Sequence() { // from class: kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$3 @Override // kotlin.sequences.Sequence public Iterator iterator() { Iterator it = longStream.iterator(); Intrinsics.checkNotNullExpressionValue(it, "iterator(...)"); return it; } }; } public static final Sequence asSequence(final DoubleStream doubleStream) { Intrinsics.checkNotNullParameter(doubleStream, ""); return new Sequence() { // from class: kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$4 @Override // kotlin.sequences.Sequence public Iterator iterator() { Iterator it = doubleStream.iterator(); Intrinsics.checkNotNullExpressionValue(it, "iterator(...)"); return it; } }; } public static final Stream asStream(final Sequence sequence) { Intrinsics.checkNotNullParameter(sequence, ""); Stream stream = StreamSupport.stream(new Supplier() { // from class: kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticLambda0 @Override // java.util.function.Supplier public final Object get() { Spliterator asStream$lambda$4; asStream$lambda$4 = StreamsKt.asStream$lambda$4(Sequence.this); return asStream$lambda$4; } }, 16, false); Intrinsics.checkNotNullExpressionValue(stream, "stream(...)"); return stream; } /* JADX INFO: Access modifiers changed from: private */ public static final Spliterator asStream$lambda$4(Sequence this_asStream) { Intrinsics.checkNotNullParameter(this_asStream, "$this_asStream"); return Spliterators.spliteratorUnknownSize(this_asStream.iterator(), 16); } public static final List toList(Stream stream) { Intrinsics.checkNotNullParameter(stream, ""); Object collect = stream.collect(Collectors.toList()); Intrinsics.checkNotNullExpressionValue(collect, "collect(...)"); return (List) collect; } public static final List toList(IntStream intStream) { Intrinsics.checkNotNullParameter(intStream, ""); int[] array = intStream.toArray(); Intrinsics.checkNotNullExpressionValue(array, "toArray(...)"); return ArraysKt.asList(array); } public static final List toList(LongStream longStream) { Intrinsics.checkNotNullParameter(longStream, ""); long[] array = longStream.toArray(); Intrinsics.checkNotNullExpressionValue(array, "toArray(...)"); return ArraysKt.asList(array); } public static final List toList(DoubleStream doubleStream) { Intrinsics.checkNotNullParameter(doubleStream, ""); double[] array = doubleStream.toArray(); Intrinsics.checkNotNullExpressionValue(array, "toArray(...)"); return ArraysKt.asList(array); } }