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 .