Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compat methods for ByteArrayOutputStream and InputStream #304

Merged
merged 6 commits into from
Dec 31, 2024

Conversation

LossyDragon
Copy link
Collaborator

@LossyDragon LossyDragon commented Dec 28, 2024

Description

Testing a project on an Android device (Google Pixel 3 XL) running Android 12 (SP1A.210812.016.C1) and caught ByteArrayOutputStream#toString() throwing NoSuchMethodError with JavaSteam and the project compiled to JDK11.

Lowering the bytecode to 1.8 on the project to let desugaring take over had no effect.

Android 12 should support Java 11, but something may have not been implemented on this device to be supported.
See https://developer.android.com/build/jdks#compileSdk

This PR replaced baos.toString() to the String alternative, which works fine now.

Edit:
Also fixes compatibility issues with InputStream.readNBytes()

Closes #307

Checklist

  • Code compiles correctly
  • All tests passing
  • Samples run successfully
  • Extended the README / documentation, if necessary

@LossyDragon LossyDragon changed the title Replace ByteArrayOutputStream#toString() with alternative. Add compat methods for ByteArrayOutputStream and InputStream Dec 29, 2024
@LossyDragon LossyDragon merged commit f380de3 into Longi94:master Dec 31, 2024
1 check passed
@LossyDragon LossyDragon deleted the binary-reader-fix branch December 31, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Various NoSuchMethodError exceptions with older Android versions or devices.
1 participant