diff --git a/src/main/java/net/schmizz/sshj/sftp/RemoteFile.java b/src/main/java/net/schmizz/sshj/sftp/RemoteFile.java index 3ee824f1d..318dd87f7 100644 --- a/src/main/java/net/schmizz/sshj/sftp/RemoteFile.java +++ b/src/main/java/net/schmizz/sshj/sftp/RemoteFile.java @@ -88,7 +88,7 @@ protected Promise asyncWrite(long fileOffset, byte[] da throws IOException { return requester.request(newRequest(PacketType.WRITE) .putUInt64(fileOffset) - .putUInt32(len - off) + .putUInt32(len) .putRawBytes(data, off, len) ); }