code: public void setTCPBufferSize(int size)
          throws IOException, ServerException {
          if (size <= 0) {
              throw new IllegalArgumentException("size <= 0");
          }
          try {
              boolean succeeded = false;
              String sizeString = Integer.toString(size);
              FeatureList feat = getFeatureList();
  
              if (feat.contains(FeatureList.SBUF)) {
                  succeeded = tryExecutingCommand( new Command("SBUF", sizeString));
              }
  
              if (!succeeded) {
                  succeeded = tryExecutingCommand( new Command("SITE BUFSIZE", sizeString));
              }
  
              if (!succeeded) {
                  succeeded = tryExecutingTwoCommands(new Command("SITE RETRBUFSIZE", sizeString),
                                                      new Command("SITE STORBUFSIZE", sizeString));
              }
  
              if (!succeeded) {
                  succeeded = tryExecutingTwoCommands(new Command("SITE RBUFSZ", sizeString),
                                                      new Command("SITE SBUFSZ", sizeString));
              }
  
              if (!succeeded) {
                  succeeded = tryExecutingTwoCommands(new Command("SITE RBUFSIZ", sizeString),
                                                      new Command("SITE SBUFSIZ", sizeString));
              }
  
              if (succeeded) {
                  this.gSession.TCPBufferSize = size;
              } else {
                  throw new ServerException(ServerException.SERVER_REFUSED,
                                            "Server refused setting TCP buffer size with any of the known commands.");
              }
  
          } catch (FTPReplyParseException rpe) {
              throw ServerException.embedFTPReplyParseException(rpe);
          }
      }
docs: Sets remote server TCP buffer size, in the following way:
  First see if server supports "SBUF" and if so, use it.
  If not, try the following commands until success:
  "SITE RETRBUFSIZE", "SITE RBUFSZ", "SITE RBUFSIZ",
  "SITE STORBUFSIZE", "SITE SBUFSZ", "SITE SBUFSIZ",
  "SITE BUFSIZE".
  Returns normally if the server confirms successfull setting of the
  remote buffer size, both for sending and for receiving data.
  Otherwise, throws ServerException.