google / cronet-transport-for-okhttp

This package allows OkHttp and Retrofit users to use Cronet as their transport layer, benefiting from features like QUIC/HTTP3 support or connection migration.
Apache License 2.0
427 stars 31 forks source link

ByteArrayOutputStream size cant be negative #14

Closed ag2s20150909 closed 1 year ago

ag2s20150909 commented 1 year ago

https://github.com/chromium/chromium/blob/0a33cb54788c73e01fe8c2b77ab36cddb270dd8b/components/cronet/android/api/src/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.java#L67-L75

https://github.com/chromium/chromium/blob/0a33cb54788c73e01fe8c2b77ab36cddb270dd8b/components/cronet/android/api/src/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.java#L108-L118

https://docs.oracle.com/javase/8/docs/api/java/io/ByteArrayOutputStream.html

ByteArrayOutputStream
public ByteArrayOutputStream(int size)
Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
Parameters:
size - the initial size.
Throws:
[IllegalArgumentException](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html) - if size is negative.
Danstahrg commented 1 year ago

Thanks for the report. This is a general Cronet issue and not an issue with this library so I'll close the bug here but will port it over to the Chromium bug tracker.