Reuse IOUtils.consume() which also avoids a PMD empty loop body error.
MODIFY
src/main/java/org/apache/commons/io/input/ObservableInputStream.java
src/main/java/org/apache/commons/io/input/ObservableInputStream.java
@@ -169,10 +169,7 @@ public void close() throws IOException {
* @throws IOException The underlying {@link InputStream}, or either of the observers has thrown an exception.
*/
public void consume() throws IOException {
- final byte[] buffer = IOUtils.byteArray();
- while (read(buffer) != EOF) {
- // empty
- }
+ IOUtils.consume(this);
}
/**

Reuse IOUtils.consume() which also avoids a PMD empty loop body error.