A stream class overrides the single-byte read or write but not the array variant
What it finds
OutputStream.write(byte[], int, int) and FilterOutputStream's version of it call write(int) once per byte, and InputStream.read(byte[], int, int) calls read() once per byte. A subclass that overrides only the single-byte method makes every bulk transfer a loop of virtual calls. For a FilterInputStream, whose bulk read passes to the wrapped stream directly, it is worse: bulk reads skip the override altogether.
The class must reach java.io.OutputStream, FilterOutputStream, InputStream or FilterInputStream through classes of the project, across files, none of which overrides the array variant.
From the rule's source, single_byte_stream_override.rs.
Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/java:stream-without-bulk-override" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/java:stream-without-bulk-override] reason="..."tx0 explain tx0/java:stream-without-bulk-override shows the same in the terminal. Found a false positive? Report it.