public String readString() throws IOException {
  int firstByte=readByte();
  int length=readInt(firstByte,PREFIX_8_BITS);
  byte[] encoded=new byte[length];
  bytesLeft-=length;
  in.readFully(encoded);
  return new String(encoded,"UTF-8");
}

public String readString ( ) throws IOException { int firstByte = readByte ( ) ; int length = readInt ( firstByte , PREFIX_8_BITS ) ; byte [ ] encoded = new byte [ length ] ; bytesLeft -= length ; in . readFully ( encoded ) ; return new String ( encoded , "UTF-8" ) ; }
reads a utf - 8 encoded string . since ascii is a subset of utf - 8 , this method may be used to read strings that are known to be ascii - only .
