diff --git a/pom.xml b/pom.xml
index 32f42b71..a6a2ee7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -167,7 +167,7 @@
commons-io
commons-io
- 2.15.1
+ 2.16.1
test
diff --git a/src/test/java/com/jcraft/jsch/AbstractBufferMargin.java b/src/test/java/com/jcraft/jsch/AbstractBufferMargin.java
index 8b152b88..3d85fa53 100644
--- a/src/test/java/com/jcraft/jsch/AbstractBufferMargin.java
+++ b/src/test/java/com/jcraft/jsch/AbstractBufferMargin.java
@@ -211,7 +211,9 @@ private void doScp(Session session, boolean debugException) throws Exception {
byte[] buf = new byte[17];
is.read(buf, 0, 17);
sendAck(os);
- Files.copy(new BoundedInputStream(is, 100L * 1024L), out);
+ Files.copy(
+ BoundedInputStream.builder().setMaxCount(100L * 1024L).setInputStream(is).get(),
+ out);
checkAck(is);
sendAck(os);
}