I am converting InputStream to JSONObject using following code. My question is, is there any simple way to convert InputStream to JSONObject. Without doing InputStream -> Bu
Make use of Jackson JSON Parser
ObjectMapper mapper = new ObjectMapper();
Map map = mapper.readValue(inputStreamObject,Map.class);
If you want specifically a JSONObject then you can convert the map
JSONObject json = new JSONObject(map);
Refer this for the usage of JSONObject constructor http://stleary.github.io/JSON-java/index.html