Skip to content

Commit 4947b57

Browse files
author
Gary Gregory
committed
Reuse IOUtils.consume() which also avoids a PMD empty loop body error.
1 parent 0732b44 commit 4947b57

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/main/java/org/apache/commons/io/input/ObservableInputStream.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,7 @@ public void close() throws IOException {
169169
* @throws IOException The underlying {@link InputStream}, or either of the observers has thrown an exception.
170170
*/
171171
public void consume() throws IOException {
172-
final byte[] buffer = IOUtils.byteArray();
173-
while (read(buffer) != EOF) {
174-
// empty
175-
}
172+
IOUtils.consume(this);
176173
}
177174

178175
/**

0 commit comments

Comments
 (0)