jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds] JCLOUDS-1187: Do not load Json payloads to memory when serializing objects (#1025)
Date Mon, 24 Oct 2016 08:41:30 GMT
nacx commented on this pull request.



> @@ -46,6 +51,27 @@ public GsonWrapper(Gson gson) {
    public <T> T fromJson(String json, Class<T> classOfT) {
       return gson.fromJson(json, classOfT);
    }
+   
+   @SuppressWarnings("unchecked")
+   @Override
+   public <T> T fromJson(InputStream json, Type type) {
+      Reader reader = new InputStreamReader(json);
+      try {
+         return (T) gson.fromJson(reader, type);
+      } finally {
+         closeQuietly(reader);

Yes, much better. Done!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1025
Mime
View raw message