public <T>T createDtoFromJson(Reader json,Class<T> dtoInterface) throws IOException {
  DtoProvider<T> dtoProvider=getDtoProvider(dtoInterface);
  StringBuilder sb=new StringBuilder();
  BufferedReader br=new BufferedReader(json);
  String line;
  while ((line=br.readLine()) != null) {
    sb.append(line);
  }
  return dtoProvider.fromJson(sb.toString());
}

public < T > T createDtoFromJson ( Reader json , Class < T > dtoInterface ) throws IOException { DtoProvider < T > dtoProvider = getDtoProvider ( dtoInterface ) ; StringBuilder sb = new StringBuilder ( ) ; BufferedReader br = new BufferedReader ( json ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { sb . append ( line ) ; } return dtoProvider . fromJson ( sb . toString ( ) ) ; }
creates new instance of class which implements specified dto interface , parses specified json data and uses parsed data for initializing fields of dto object .
