{"action":"opened","issue":{"url":"https://api.github.com/repos/3sidedcube/Android-LightningUtil/issues/1","labels_url":"https://api.github.com/repos/3sidedcube/Android-LightningUtil/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/3sidedcube/Android-LightningUtil/issues/1/comments","events_url":"https://api.github.com/repos/3sidedcube/Android-LightningUtil/issues/1/events","html_url":"https://github.com/3sidedcube/Android-LightningUtil/issues/1","id":69106494,"number":1,"title":"Optimise file reader","user":{"login":"scruffyfox","id":1050665,"avatar_url":"https://avatars.githubusercontent.com/u/1050665?v=3","gravatar_id":"","url":"https://api.github.com/users/scruffyfox","html_url":"https://github.com/scruffyfox","followers_url":"https://api.github.com/users/scruffyfox/followers","following_url":"https://api.github.com/users/scruffyfox/following{/other_user}","gists_url":"https://api.github.com/users/scruffyfox/gists{/gist_id}","starred_url":"https://api.github.com/users/scruffyfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scruffyfox/subscriptions","organizations_url":"https://api.github.com/users/scruffyfox/orgs","repos_url":"https://api.github.com/users/scruffyfox/repos","events_url":"https://api.github.com/users/scruffyfox/events{/privacy}","received_events_url":"https://api.github.com/users/scruffyfox/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/3sidedcube/Android-LightningUtil/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-17T09:50:58Z","updated_at":"2015-04-17T09:50:58Z","closed_at":null,"body":"Change the way the json files are read from disk\r\n\r\n1) create methods to return input stream instead of byte[]\r\n2) FileManager#readFile should be using `while ((len = input.read(buffer)) > -1)` instead of `while ((len = input.read(buffer)) > 0)`\r\n3) loading storm content should be using input streams and readers to load the json\r\n\r\nE.G.\r\n\r\n```java\r\n// TODO: This will return an input stream instead of a byte[]\r\nbyte[] identifiersData = ContentSettings.getInstance().getFileFactory().loadFromUri(path);\r\n\r\ntry\r\n{\r\n\tBufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(identifiersData, 0, identifiersData.length));\r\n\tnew JsonParser().parse(new InputStreamReader(bis));\r\n}\r\ncatch (Exception e)\r\n{\r\n\te.printStackTrace();\r\n}\r\n```"}}