public static <T> List<T> reads(
		final Reader<? extends T> reader,
		final DataInput in
	)
		throws IOException
	{
		final int length = readInt(in);
		final List<T> elements = new ArrayList<>(length);
		for (int i = 0; i < length; ++i) {
			elements.add(reader.read(in));
		}
		return elements;
	}
Reads a list of elements from the given data input.

@param reader the element reader
@param in the data input
@param <T> the element type
@return the read element list
@throws NullPointerException if one of the given arguments is {@code null}
@throws IOException if an I/O error occurs
jenetics/src/main/java/io/jenetics/internal/util/SerialIO.java