#18 Need a way to set/get packet size in SftpClient

General Request
open
nobody
J2SSH (7)
5
2006-09-21
2006-09-21
Howard Ungar
No

I was unable to put via SFTP as I was getting a packet
too large error. In order to accomodate, I have
modified my local copy of SftpClient such that the
following methods exist (these would be very useful in
full version):

/**
* <p>
* Allows the packet size of 65535 or less to be
specified from the client
* (Default packet size is 65535)
* </p>
*
* @param packetSize Size of desired packet
* @since 0.2.0
*/
public void setPacketSize (int packetSize)
{ BLOCKSIZE = ( packetSize <= 65535 ?
packetSize : BLOCKSIZE); }

/**
* <p>
* Returns the currently defined packed size
* (Default packet size is 65535)
* </p>
*
* @return The current packet size
* @since 0.2.0
*/
public int getPacketSize()
{ return BLOCKSIZE; }

Discussion