| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| * Zero-copy override: returns the backing array directly when fully used, | ||
| * skipping the base-class BAOS allocation + copy on every decompressor call. | ||
| * Returning the mutable array is safe — the base class already exposes a | ||
| * mutable {@code BAOS.getBuf()}. |
There was a problem hiding this comment.
I think Returning the mutable array is safe is the key. The array was mutable before, but it was a mutable copy of the original array.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
#3565 introduced several optimizations, but I think it also introduced an issue that PR seeks to address. Basically BytesInput.copy(BytesInput) has a public contract to return a copy, but a change to BytesInput.toByteArray() led to returning a reference in some cases. In addition to breaking the public contract, this can lead to data corruption.
See also #3717