Add bulk read method to InputStream implementations
MSALAdds a read(byte[], int, int) method to InputStream subclasses that only override the single-byte read() method. Java's default InputStream.read(byte[], int, int) implementation calls the single-byte read() method in a loop, which can cause severe performance degradation (up to 350x slower) for bulk reads. This recipe detects InputStream implementations that delegate to another stream and adds the missing bulk read method to delegate bulk reads as well. Implementations whose read() body is too complex to delegate safely get a TODO comment instead, to implement the bulk read method by hand.
org. openrewrite. java. migrate. io. AddInputStreamBulkReadMethodmod run . --recipe= org. openrewrite. java. migrate. io. AddInputStreamBulkReadMethodInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.