code: public static String readString(DataInputStream dis) throws IOException {
          byte[] bytes = new byte[MAX_SIZE];
          byte b = dis.readByte();
          int i = -1;
          StringBuilder sb = new StringBuilder();
          while (b != 32 && b != 10) {
              i++;
              bytes[i] = b;
              b = dis.readByte();
              if (i == 49) {
                  sb.append(new String(bytes, "UTF-8"));
                  i = -1;
                  bytes = new byte[MAX_SIZE];
              }
          }
          sb.append(new String(bytes, 0, i + 1, "UTF-8"));
          return sb.toString();
      }
docs: Read a string from a data input stream Credit to:
  https://github.com/NLPchina/Word2VEC_java/blob/master/src/com/ansj/vec/Word2VEC.java
  
  @param dis
  @return
  @throws IOException