{"action":"opened","issue":{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/897","labels_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/897/labels{/name}","comments_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/897/comments","events_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/897/events","html_url":"https://github.com/AsyncHttpClient/async-http-client/issues/897","id":83113810,"number":897,"title":"Response is wrong. something to fix it?","user":{"login":"StigmaKim","id":11647938,"avatar_url":"https://avatars.githubusercontent.com/u/11647938?v=3","gravatar_id":"","url":"https://api.github.com/users/StigmaKim","html_url":"https://github.com/StigmaKim","followers_url":"https://api.github.com/users/StigmaKim/followers","following_url":"https://api.github.com/users/StigmaKim/following{/other_user}","gists_url":"https://api.github.com/users/StigmaKim/gists{/gist_id}","starred_url":"https://api.github.com/users/StigmaKim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StigmaKim/subscriptions","organizations_url":"https://api.github.com/users/StigmaKim/orgs","repos_url":"https://api.github.com/users/StigmaKim/repos","events_url":"https://api.github.com/users/StigmaKim/events{/privacy}","received_events_url":"https://api.github.com/users/StigmaKim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-31T15:34:47Z","updated_at":"2015-05-31T15:34:47Z","closed_at":null,"body":"I'm in trouble with parsing Json buffer data to image.\r\n\r\nHere is my Node.js code and data. I send it to my android app using res.send(docs).\r\n\r\nquery.findOne(function(err, docs){\r\n    if(!err){\r\n        console.log(docs);\r\n        res.send(docs);\r\n    }\r\n});\r\n\r\n{ _id: 555ee1f5be40576c28c3e228,\r\n    email: 'hh@hh.h',\r\n    pw: 'aa',\r\n    name: 'jimy',\r\n    phone: '22222222222',\r\n    __v: 0,\r\n    img: \r\n     { _bsontype: 'Binary',\r\n       sub_type: 0,\r\n       position: 4146282,\r\n       buffer: <Buffer ff d8 ff e1 96 f8 45 78 69 66 00 00 4d 4d 00 2a 00 00...}\r\n}\r\n\r\nand here is my android app code. I tried AsyncHttpResponseHandler, BinaryHttpResponseHandler and so on. and get the same result.\r\n\r\nHttpClient.post(\"getMember/\", param, new AsyncHttpResponseHandler() {\r\n    @Override\r\n    public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\r\n        JSONArray jarr;\r\n        JSONObject obj;\r\n        try {\r\n            jarr = new JSONArray(new String(responseBody));\r\n            obj = jarr.getJSONObject(0);\r\n\r\n            email_edt.setText(obj.get(\"email\").toString());\r\n            pw_edt.setText(obj.get(\"pw\").toString());\r\n            name_edt.setText(obj.get(\"name\").toString());\r\n            phone_edt.setText(obj.get(\"phone\").toString());\r\n        }\r\n   }\r\n}\r\nthis code works well at document without img buffer field. but when it get response including img buffer, It takes long time, and fired \"OutOfMemory\" Error.\r\n\r\nI don't use obj.get(\"img\"), just get responseBody and parsing it to JSONObject. \r\n\r\ndocument's size is about 4BM, It is not too large, but in my android studio, log like below so many times.\r\n\r\nGrow heap (frag case) to 131.704MB for 38189042-byte allocation\r\n05-29 17:38:51.097  17193-17193/com.capstone.bookkeepingproto2 D/dalvikvm﹕ GC_FOR_ALLOC freed 26910K, 42% free 107442K/183252K, paused 266ms, total 266ms\r\n05-29 17:38:52.177  17193-17193/com.capstone.bookkeepingproto2 D/dalvikvm﹕ GC_FOR_ALLOC freed 8192K, 42% free 107442K/183252K, paused 277ms, total 277ms\r\n05-29 17:38:53.257  17193-17193/com.capstone.bookkeepingproto2 D/dalvikvm﹕ GC_FOR_ALLOC fre\r\n\r\nI don't know what is a problem. I spend so much times on it. Please Help me.\r\n\r\nIf It is impossible to overcome, I'd like to get another way to get image data from server. My due date is coming.. Please Help me."}}