Code example for InputStreamReader

0
      out.write(new Gson().toJson(this).getBytes());
    } 
 
    public static NumberFilterStorage fromStream(InputStream in) throws IOException {
      try { 
        return new Gson().fromJson(new BufferedReader(new InputStreamReader(in)),
                                   NumberFilterStorage.class); 
      } catch (JsonParseException jpe) {
        Log.w("NumberFilter", jpe);
        throw new IOException("JSON Parse Exception");
      } 
    } 
  } 
}