You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider#newOutputStream method, SftpOutputStreamAsync is decorated by FilterOutputStream.
the java.io.FilterOutputStream#write(byte[], int, int) method will invoke the org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync#write(int) method each byte in a loop, this cause the buffer in SftpOutputStreamAsync is Invalidation。
Actual behavior
at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider#newOutputStream method, SftpOutputStreamAsync is decorated by FilterOutputStream.
the java.io.FilterOutputStream#write(byte[], int, int) method will invoke the org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync#write(int) method each byte in a loop, this cause the buffer in SftpOutputStreamAsync is Invalidation。
Expected behavior
override the java.io.FilterOutputStream#write(byte[], int, int) method in org.apache.sshd.sftp.client.fs.SftpFileSystemProvider#newOutputStream like below:
return new FilterOutputStream(client.write(p.toString(), modes)) {
@Override
public void close() throws IOException {
try {
super.close();
} finally {
client.close();
}
}
@Override
public void write(byte b[], int off, int len) throws IOException {
if ((off | len | (b.length - (len + off)) | (off + len)) < 0) {
throw new IndexOutOfBoundsException();
}
out.write(b, off, len);
}
};
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
The default implementation calls write(int) for every byte, which may
be very inefficient. Override it in the few cases where we use a
FilterOutputStream to pass through the operation to the underlying
OutputStream, which is also responsible for any index and length
validations.
Bug: apache#407
The default implementation calls write(int) for every byte, which may
be very inefficient. Override it in the few cases where we use a
FilterOutputStream to pass through the operation to the underlying
OutputStream, which is also responsible for any index and length
validations.
Bug: apache#407
Version
2.10.0
Bug description
at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider#newOutputStream method, SftpOutputStreamAsync is decorated by FilterOutputStream.
the java.io.FilterOutputStream#write(byte[], int, int) method will invoke the org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync#write(int) method each byte in a loop, this cause the buffer in SftpOutputStreamAsync is Invalidation。
Actual behavior
at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider#newOutputStream method, SftpOutputStreamAsync is decorated by FilterOutputStream.
the java.io.FilterOutputStream#write(byte[], int, int) method will invoke the org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync#write(int) method each byte in a loop, this cause the buffer in SftpOutputStreamAsync is Invalidation。
Expected behavior
override the java.io.FilterOutputStream#write(byte[], int, int) method in org.apache.sshd.sftp.client.fs.SftpFileSystemProvider#newOutputStream like below:
return new FilterOutputStream(client.write(p.toString(), modes)) {
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered: