public String readString() throws TException {
  int length=readVarint32();
  checkStringReadLength(length);
  if (length == 0) {
    return "";
  }
  try {
    if (trans_.getBytesRemainingInBuffer() >= length) {
      String str=new String(trans_.getBuffer(),trans_.getBufferPosition(),length,"UTF-8");
      trans_.consumeBuffer(length);
      return str;
    }
 else {
      return new String(readBinary(length),"UTF-8");
    }
  }
 catch (  UnsupportedEncodingException e) {
    throw new TException("UTF-8 not supported!");
  }
}

public String readString ( ) throws TException { int length = readVarint32 ( ) ; checkStringReadLength ( length ) ; if ( length == 0 ) { return "" ; } try { if ( trans_ . getBytesRemainingInBuffer ( ) >= length ) { String str = new String ( trans_ . getBuffer ( ) , trans_ . getBufferPosition ( ) , length , "UTF-8" ) ; trans_ . consumeBuffer ( length ) ; return str ; } else { return new String ( readBinary ( length ) , "UTF-8" ) ; } } catch ( UnsupportedEncodingException e ) { throw new TException ( "UTF-8 not supported!" ) ; } }
reads a byte [ ] ( via readbinary ) , and then utf - 8 decodes it .
