{"id":15068764,"url":"https://github.com/stefan-zobel/streamsupport","last_synced_at":"2025-10-05T06:31:56.121Z","repository":{"id":30056092,"uuid":"123790381","full_name":"stefan-zobel/streamsupport","owner":"stefan-zobel","description":"Backport of Java 8/9 java.util.stream API to Java 6/7 and Android","archived":true,"fork":false,"pushed_at":"2024-01-21T20:15:30.000Z","size":3896,"stargazers_count":189,"open_issues_count":0,"forks_count":29,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-13T22:24:14.245Z","etag":null,"topics":["android","completablefuture","flow","java10","java8","java9","jep-266","reactive-streams","stream-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefan-zobel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-04T13:19:21.000Z","updated_at":"2024-12-17T02:31:24.000Z","dependencies_parsed_at":"2023-01-14T16:12:25.851Z","dependency_job_id":null,"html_url":"https://github.com/stefan-zobel/streamsupport","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefan-zobel%2Fstreamsupport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefan-zobel%2Fstreamsupport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefan-zobel%2Fstreamsupport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefan-zobel%2Fstreamsupport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefan-zobel","download_url":"https://codeload.github.com/stefan-zobel/streamsupport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235374482,"owners_count":18979732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","completablefuture","flow","java10","java8","java9","jep-266","reactive-streams","stream-api"],"created_at":"2024-09-25T01:39:10.518Z","updated_at":"2025-10-05T06:31:55.554Z","avatar_url":"https://github.com/stefan-zobel.png","language":"Java","readme":"[![Total alerts](https://img.shields.io/lgtm/alerts/g/stefan-zobel/streamsupport.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/stefan-zobel/streamsupport/alerts/)\r\n[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/stefan-zobel/streamsupport.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/stefan-zobel/streamsupport/context:java)\r\n[![Maven Central](https://img.shields.io/maven-central/v/net.sourceforge.streamsupport/streamsupport.svg)](http://mvnrepository.com/artifact/net.sourceforge.streamsupport/streamsupport)\r\n[![javadoc.io](https://javadoc.io/badge2/net.sourceforge.streamsupport/streamsupport/javadoc.svg)](https://javadoc.io/doc/net.sourceforge.streamsupport/streamsupport)\r\n\r\n# streamsupport\r\n\r\n![](art/streamsupport-sf.png)\r\n\r\nstreamsupport is a backport of the Java 8 `java.util.function` (functional interfaces) and `java.util.stream`\r\n(streams) API for Android and users of Java 6 or 7 supplemented with selected additions from `java.util.concurrent`\r\nwhich didn't exist back in Java 6.\r\n\r\nDue to the lack of default interface methods and static interface methods in pre-Java 8 the API had to be slightly\r\nadjusted in these areas but still covers the full functionality scope of Java 8. In detail, static and default\r\ninterface methods have been moved to companion classes in the same package that bear the identical name as the\r\ninterface but with an \"s\" appended (e.g. `Comparator` -\u003e `Comparators`).\r\n\r\nFor ease of use, the default methods for most of the functional interfaces were NOT retained as abstract methods\r\nin the redefined interfaces (keeping them single method interfaces) - the missing default (and static) methods can\r\nalways be found in the corresponding companion class.\r\n\r\nThe streamsupport API lives in the packages `java8.util.*` and `java8.lang` respectively. So, it's not possible to\r\nsimply import the `java.util.stream` package in your code - you'd rather have to use `java8.util.stream` instead\r\n(see [Readme.txt](https://github.com/stefan-zobel/streamsupport/blob/master/Readme.txt) for details). While that\r\nis fine as long as you have full control over your source code there is the other common scenario of using a binary\r\n3rd party dependency that has been compiled against the standard Java 8 `java.util.stream` API. In the latter case\r\nbytecode rewriting via [ProGuard](https://github.com/Guardsquare/proguard) might be an option. ProGuard supports\r\nmost Java 8 language features and the latest release can also replace the standard Java 8 stream API by the the\r\nstreamsupport backport (cf. the Proguard [documentation](https://www.guardsquare.com/manual/languages/java),\r\nespecially the section titled \"Java 8 stream API support\").\r\n\r\nThe current stable release of streamsupport is `streamsupport-1.7.4`.\r\n\r\nWant also lambdas? https://github.com/orfjackal/retrolambda\r\n\r\nNote that the [streamsupport sourceforge](https://sourceforge.net/projects/streamsupport/) site has been discontinued.\r\nNew developments, if any, will take place here.\r\n\r\nPlease give feedback [here](https://github.com/stefan-zobel/streamsupport/issues) if you experience any problems.\r\n\r\n\r\n## Features\r\n\r\n* Java 8 / Java 9 Streams library backport\r\n* Java 8 / Java 9 CompletableFuture backport\r\n* Java 8 Parallel array operations backport\r\n* Java 8 Functional interfaces backport\r\n* Further java.util.concurrent enhancements from Java 7/8 backported to Java 6\r\n* Includes miscellaneous Java 8 / Java 9 goodies (Optional, StringJoiner, ...)\r\n* Supports Android - all versions, starting from Ice Cream Sandwich\r\n\r\n\r\n### build.gradle:\r\n\r\n```gradle\r\ndependencies {\r\n    implementation 'net.sourceforge.streamsupport:streamsupport:1.7.4'\r\n}\r\n```\r\n\r\n\r\n### Maven:\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003enet.sourceforge.streamsupport\u003c/groupId\u003e\r\n    \u003cartifactId\u003estreamsupport\u003c/artifactId\u003e\r\n    \u003cversion\u003e1.7.4\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n\r\n### All-in-One JAR:\r\nContains streamsupport core + atomic + cfuture + flow\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003enet.sourceforge.streamsupport\u003c/groupId\u003e\r\n    \u003cartifactId\u003estreamsupport_all\u003c/artifactId\u003e\r\n    \u003cversion\u003e1.7.4\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n\r\n### Example usage\r\n\r\n```java\r\nimport java.util.List;\r\nimport java8.util.stream.IntStreams;\r\nimport java8.util.stream.StreamSupport;\r\nimport static java8.util.stream.Collectors.toList;\r\n\r\nList\u003cInteger\u003e list = IntStreams.of(1, 2, 3, 4).boxed()\r\n        .collect(toList());\r\n\r\nList\u003cInteger\u003e incremented = StreamSupport.stream(list)\r\n        .map(i -\u003e i + 1)\r\n        .collect(toList());\r\n```\r\n\r\n### Forks\r\n\r\n\r\nAndroid developers using the Android Studio 3.x toolchain should have a look at the `streamsupport` forks:\r\n\r\n* [android-retrostreams](https://github.com/retrostreams/android-retrostreams)\r\n* [android-retrofuture](https://github.com/retrostreams/android-retrofuture)\r\n* [android-retroflow](https://github.com/retrostreams/android-retroflow)\r\n* [android-retroatomic](https://github.com/retrostreams/android-retroatomic)\r\n\r\n\r\n## Release Notes\r\n\r\n[Release Notes](Readme.txt)\r\n\r\n\r\n## LICENSE\r\n\r\nGNU General Public License, version 2, [with the Classpath Exception](https://github.com/stefan-zobel/streamsupport/blob/master/GPL_ClasspathException) (and [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) for JSR-166 derived code)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefan-zobel%2Fstreamsupport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefan-zobel%2Fstreamsupport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefan-zobel%2Fstreamsupport/lists"}