public static <T> List<T> readCollection(DataInput in, Reader<? extends T> reader) throws IOException {
    return readCollection(in, reader, new SmartList<T>());
  }
public static <T> List<T> readCollection(DataInput in, Reader<? extends T> reader)