ICUBinary.getByteBufferFromInputStream() tries to read all bytes from an InputStream into a byte array. It reads chunks of is.available() bytes. This seems to work fine on a normal JDK, but some library implementations and InputStream instances return very pessimistic values from available(), maybe even always 1, as long as anything is available. This causes a huge number of reallocations in the current getByteBufferFromInputStream() code.
The recommendation seems to be to not use available() at all, but to call read() until it returns a negative value, something like
PS: Apparently it is even permitted for available() to return 0 even when not at the end of the stream yet. In that case, the current code would read only part of the stream.