I'm trying to read json with gson, but I can't get a "simple" gson example to work. 

From: <https://sites.google.com/site/gson/streaming>

```
    public List<Message> readJsonStream(InputStream in) throws IOException {
      JsonReader reader = new JsonReader(new InputStreamReader(in, "UTF-8"));
      List<Message> messages = new ArrayList<Message>();
      reader.beginArray();
      while (reader.hasNext()) {
          Message message = gson.fromJson(reader, Message.class);
          messages.add(message);
      }
      reader.endArray();
      reader.close();
      return messages;
   }

```

Here's the problem, if I try with:

```
JsonReader reader;
Gson gson = new Gson();
gson.fromJson(reader,Program.class);

```

It doesn't even build. 

```
The method fromJson(String, Class<T>) in the type Gson is not applicable for the arguments (JsonReader, Class<Program>)

```

There seems to be a method according to eclipse:
**fromJson(JsonReader arg0, Type arg1)**