public static long[] readTimesFromStream(DataInputStream stream, int size) throws IOException {
    long[] times = new long[size];
    for (int i = 0; i < size; i++) {
      times[i] = stream.readLong();
    }
    return times;
  }
To fetch required amounts of data and combine them through List

@param queryExecution used to get TsBlock from and judge whether there is more data.
@param fetchSize wanted row size
@return pair.left is serialized TsBlock pair.right indicates if the read finished
@throws IoTDBException IoTDBException may be thrown if error happened while getting TsBlock
    from IQueryExecution
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java