public final String readString() {
    int len = readU32();
    if (len > maxStringLength)
      throw new ErrorException("InStream max string length exceeded");

    byte[] str = new byte[len];
    readBytes(str, 0, len);
    String utf8string = new String();
    try {
      utf8string = new String(str, "UTF8");
    } catch(java.io.UnsupportedEncodingException e) {
      e.printStackTrace();
    }
    return utf8string;
  }