public void appendToQuery(String buffer){
  if (this.queryAsBytes == null)   query=query + buffer;
 else {
    String charset=getCharset();
    byte[] appendBuffer;
    if (charset == null)     appendBuffer=buffer.getBytes();
 else {
      try {
        appendBuffer=buffer.getBytes(charset);
      }
 catch (      UnsupportedEncodingException e) {
        appendBuffer=buffer.getBytes();
      }
    }
    byte[] buf=new byte[queryAsBytes.length + appendBuffer.length];
    System.arraycopy(queryAsBytes,0,buf,0,queryAsBytes.length);
    System.arraycopy(appendBuffer,0,buf,queryAsBytes.length,appendBuffer.length);
    queryAsBytes=buf;
    queryAsBytesTranslated=null;
  }
}

public void appendToQuery ( String buffer ) { if ( this . queryAsBytes == null ) query = query + buffer ; else { String charset = getCharset ( ) ; byte [ ] appendBuffer ; if ( charset == null ) appendBuffer = buffer . getBytes ( ) ; else { try { appendBuffer = buffer . getBytes ( charset ) ; } catch ( UnsupportedEncodingException e ) { appendBuffer = buffer . getBytes ( ) ; } } byte [ ] buf = new byte [ queryAsBytes . length + appendBuffer . length ] ; System . arraycopy ( queryAsBytes , 0 , buf , 0 , queryAsBytes . length ) ; System . arraycopy ( appendBuffer , 0 , buf , queryAsBytes . length , appendBuffer . length ) ; queryAsBytes = buf ; queryAsBytesTranslated = null ; } }
append to the query , translating if necessary to a byte buffer if the query is stored in bytes .
