Back to project page libraryofalexandria.
The source code is released under:
Apache License
If you think the Android project libraryofalexandria listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package alexandria.israelferrer.com.libraryofalexandria; /*w w w .j av a 2 s. com*/ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.io.InputStream; import java.io.InputStreamReader; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ArtWorkServiceImpl implements ArtWorkService { private final InputStream source; private List<ArtWork> artWorkList; public ArtWorkServiceImpl(InputStream source) { this.source = source; this.artWorkList = new ArrayList<ArtWork>(); } @Override public void getArtWorks(Callback<List<ArtWork>> result) { Type listType = new TypeToken<List<ArtWork>>() { }.getType(); artWorkList = new Gson().fromJson(new InputStreamReader(source), listType); result.success(artWorkList); } }