Code example for Gson

Methods: fromJson

0
    } 
 
    @Override 
    public T from(byte[] bytes) {
	Reader reader = new InputStreamReader(new ByteArrayInputStream(bytes));
	return gson.fromJson(reader, type);
    } 
 
    @Override 
    public void toStream(T object, OutputStream bytes) throws IOException {
	Writer writer = new OutputStreamWriter(bytes);
	gson.toJson(object, writer);
	writer.close();
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java