src/main/java/pityoulish/sockets/client/TLVRequestBuilderImpl.java
protected MsgBoardTLV buildSingleStringRequest(int estimate,
                                                 MsgBoardType reqtype,
                                                 MsgBoardType argtype,
                                                 String arg, boolean utf8)
  {
    if (estimate < 1)
       estimate = estimateLength(arg, utf8);

    byte[] data = new byte[estimate];

    MsgBoardTLV request = new MsgBoardTLV(reqtype, data, 0);
    MsgBoardTLV param = request.appendTLV(argtype);
    param.setTextValue(arg, utf8 ? "UTF-8" : "US-ASCII");
    request.addToLength(param.getSize());

    //System.out.println("@@@ "+request.toFullString());

    return request;
  }
/**
   * Builds a request with a single string as argument.
   * The caller may choose to append more arguments afterwards.
   *
   * @param estimate    the estimated length; 0 or negative for none.
   *                    If positive, the value MUST be sufficient to hold
   *                    the complete TLV.
   * @param reqtype     the type of the request TLV to build
   * @param argtype     the type of the argument TLV to include
   * @param arg         the argument string to include
   * @param utf8        <code>true</code> for UTF-8 encoding,
   *                    <code>false</code> for US-ASCII
   *
   * @return a TLV constructed from the arguments.
   *    If <code>estimate</code> was positive, the underlying byte array
   *    has exactly that size.
   */
Builds a request with a single string as argument.
The caller may choose to append more arguments afterwards.

@param estimate    the estimated length; 0 or negative for none.
If positive, the value MUST be sufficient to hold
the complete TLV.
@param reqtype     the type of the request TLV to build
@param argtype     the type of the argument TLV to include
@param arg         the argument string to include
@param utf8        true for UTF-8 encoding,
false for US-ASCII

@return a TLV constructed from the arguments.
If estimate was positive, the underlying byte array
has exactly that size.
Builds a request with a single string as argument . The caller may choose to append more arguments afterwards . @param estimate the estimated length ; 0 or negative for none . If positive the value MUST be sufficient to hold the complete TLV . @param reqtype the type of the request TLV to build @param argtype the type of the argument TLV to include @param arg the argument string to include @param utf8 true for UTF - 8 encoding false for US - ASCII @return a TLV constructed from the arguments . If estimate was positive the underlying byte array has exactly that size .
protected MsgBoardTLV buildSingleStringRequest(int estimate,
                                                 MsgBoardType reqtype,
                                                 MsgBoardType argtype,
                                                 String arg, boolean utf8)
  {
    if (estimate < 1)
       estimate = estimateLength(arg, utf8);
    byte[] data = new byte[estimate];
    MsgBoardTLV request = new MsgBoardTLV(reqtype, data, 0);
    MsgBoardTLV param = request.appendTLV(argtype);
    param.setTextValue(arg, utf8 ? "UTF-8" : "US-ASCII");
    request.addToLength(param.getSize());
    return request;
  }
protected MsgBoardTLV buildSingleStringRequest ( int estimate , MsgBoardType reqtype , MsgBoardType argtype , String arg , boolean utf8 ) { if ( estimate < 1 ) estimate = estimateLength ( arg , utf8 ) ; byte [ ] data = new byte [ estimate ] ; MsgBoardTLV request = new MsgBoardTLV ( reqtype , data , 0 ) ; MsgBoardTLV param = request . appendTLV ( argtype ) ; param . setTextValue ( arg , utf8 ? "UTF-8" : "US-ASCII" ) ; request . addToLength ( param . getSize ( ) ) ; return request ; }
Builds a request with a single string as argument.
Builds a request with a single string as argument .
//System.out.println("@@@ "+request.toFullString());