public static String readShortString(DataInputStream input) throws IOException {
    Short size = input.readShort();
    if (size < 0) {
      throw new IllegalArgumentException("readShortString : the size " + size + " cannot be negative");
    }
    byte[] bytes = new byte[size];
    int read = 0;
    while (read < size) {
      int readBytes = input.read(bytes, read, size - read);
      if (readBytes == -1 || readBytes == 0) {
        break;
      }
      read += readBytes;
    }
    if (read != size) {
      throw new IllegalArgumentException(
          "readShortString : the size of the input does not match the actual data size: " + read + " != " + size);
    }
    return new String(bytes, StandardCharsets.UTF_8);
  }
Reads a String whose length is a short from the given input stream
@param input The input stream from which to read the String from
@return The String read from the stream
@throws IOException
ambry-utils/src/main/java/com/github/ambry/utils/Utils.java