{"id":15068779,"url":"https://github.com/retrostreams/android-retrostreams","last_synced_at":"2025-10-05T08:30:47.704Z","repository":{"id":22647686,"uuid":"96631163","full_name":"retrostreams/android-retrostreams","owner":"retrostreams","description":"Backport of Java 9 java.util.stream API for Android Studio 3.x D8 / desugar toolchain, forked from https://github.com/stefan-zobel/streamsupport","archived":true,"fork":false,"pushed_at":"2023-05-09T18:28:11.000Z","size":4976,"stargazers_count":109,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-09-30T13:42:45.935Z","etag":null,"topics":["android","java8","java9","stream-api"],"latest_commit_sha":null,"homepage":"https://retrostreams.github.io/android-retrostreams/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retrostreams.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":"2017-07-08T16:38:33.000Z","updated_at":"2024-03-21T10:41:14.000Z","dependencies_parsed_at":"2023-01-13T22:06:40.259Z","dependency_job_id":null,"html_url":"https://github.com/retrostreams/android-retrostreams","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrostreams%2Fandroid-retrostreams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrostreams%2Fandroid-retrostreams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrostreams%2Fandroid-retrostreams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrostreams%2Fandroid-retrostreams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retrostreams","download_url":"https://codeload.github.com/retrostreams/android-retrostreams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235378529,"owners_count":18980464,"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","java8","java9","stream-api"],"created_at":"2024-09-25T01:39:16.269Z","updated_at":"2025-10-05T08:30:41.833Z","avatar_url":"https://github.com/retrostreams.png","language":"Java","readme":"[![Maven Central](https://img.shields.io/maven-central/v/net.sourceforge.streamsupport/android-retrostreams.svg)](http://mvnrepository.com/artifact/net.sourceforge.streamsupport/android-retrostreams)\r\n[![javadoc.io](https://javadoc.io/badge2/net.sourceforge.streamsupport/android-retrostreams/javadoc.svg)](https://javadoc.io/doc/net.sourceforge.streamsupport/android-retrostreams)\r\n\r\n# android-retrostreams\r\n\r\n![](art/streamsupport-sf.png)\r\n\r\nandroid-retrostreams is a fork of the [streamsupport library](https://github.com/stefan-zobel/streamsupport)\r\ntargeted at Android developers who want to take advantage of Android Studio 3.x D8 / desugar toolchain's\r\ncapability to use interface default \u0026 static methods across Jar file boundaries.\r\n\r\nUtilizing this feature of desugar, the streamsupport API can be even more aligned with the original\r\nJava 8 / 9 API exposed in the java.util.function and java.util.stream packages. That allows for Android\r\napp's code to be much more in accordance with the standard Java 8 / 9 usage than it is now possible with the\r\noriginal streamsupport API (which is bound by the restrictions of supporting Java 6).\r\n\r\nWith respect to static / default interface methods the android-retrostreams public API should now be\r\nidentical to the Java 9 API wherever this is possible (i.e. for all interfaces that have first been\r\nintroduced in Java 8).\r\n\r\nSupplemental helper classes, public static methods and so on that served as a replacement for the\r\ndefault / static interfaces methods in the original streamsupport API are now mostly gone.\r\nE.g., no `j8.u.s.RefStreams` class anymore - all these methods are now in the `j9.u.s.Stream` interface.\r\n\r\nThe retrostreams API lives in the packages `java9.util.*` and `java9.lang` respectively. So, it's not possible\r\nto simply import the `java.util.stream` package in your code - you'd rather have to use `java9.util.stream` instead.\r\nWhile that is fine as long as you have full control over your source code there is the other common scenario of using\r\na binary 3rd party dependency that has been compiled against the standard Java 8 `java.util.stream` API. In the latter\r\ncase bytecode 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\r\n[streamsupport](https://github.com/stefan-zobel/streamsupport) backport (cf. the Proguard [documentation](https://www.guardsquare.com/en/products/proguard/manual/gradleplugin), especially the section titled \"Java 8 stream API support\"),\r\ni.e., in this case, switching to the older [streamsupport](https://github.com/stefan-zobel/streamsupport) backport instead\r\nof using android-retrostreams might be the more promising approach.\r\n\r\nThe [online Javadoc](https://retrostreams.github.io/android-retrostreams/apidocs/index.html) gives a\r\npicture of the API changes.\r\n\r\nThe current stable release of retrostreams is `android-retrostreams-1.7.4`.\r\n\r\nPlease give feedback [here](https://github.com/retrostreams/android-retrostreams/issues) if you experience\r\nany problems.\r\n\r\n\r\n### build.gradle:\r\n\r\n```gradle\r\ndependencies {\r\n    implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.4'\r\n}\r\n```\r\n\r\n\r\n### All-in-One JAR:\r\nContains android-retrostreams core + retroatomic + retroflow + retrofuture\r\n\r\n```gradle\r\ndependencies {\r\n    implementation 'net.sourceforge.streamsupport:android-retrostreams_all:1.7.4'\r\n}\r\n```\r\n\r\n\r\n### Example usage\r\n\r\n```java\r\nimport java.util.List;\r\nimport java9.util.stream.Stream;\r\nimport java9.util.stream.StreamSupport;\r\nimport static java9.util.stream.Collectors.toList;\r\n\r\nList\u003cInteger\u003e list = Stream.of(1, 2, 3, 4).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### Sibling projects\r\n\r\nYou might also have a use for one of `retrostreams'` sibling projects:\r\n\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## LICENSE\r\n\r\nGNU General Public License, version 2, [with the Classpath Exception](https://github.com/retrostreams/android-retrostreams/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%2Fretrostreams%2Fandroid-retrostreams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretrostreams%2Fandroid-retrostreams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrostreams%2Fandroid-retrostreams/lists"}