mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 08:10:55 +03:00
Fixed length bug in putString (Fixes #187)
This commit is contained in:
@@ -246,7 +246,7 @@ public class Buffer<T extends Buffer<T>> {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public T putBytes(byte[] b, int off, int len) {
|
public T putBytes(byte[] b, int off, int len) {
|
||||||
return putUInt32(len - off).putRawBytes(b, off, len);
|
return putUInt32(len).putRawBytes(b, off, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readRawBytes(byte[] buf)
|
public void readRawBytes(byte[] buf)
|
||||||
|
|||||||
@@ -82,9 +82,7 @@ public class RemoteFile
|
|||||||
throws IOException {
|
throws IOException {
|
||||||
return requester.request(newRequest(PacketType.WRITE)
|
return requester.request(newRequest(PacketType.WRITE)
|
||||||
.putUInt64(fileOffset)
|
.putUInt64(fileOffset)
|
||||||
// TODO The SFTP spec claims this field is unneeded...? See #187
|
.putString(data, off, len)
|
||||||
.putUInt32(len)
|
|
||||||
.putRawBytes(data, off, len)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user