Permalink
Browse files

Fix bug

Signed-off-by: Simone <hello@simonewebdesign.it>
  • Loading branch information...
1 parent 86b4f99 commit f0d18b8df2cf7bf6e85d96d69aa1cbfdf5de6c15 @simonewebdesign committed Mar 6, 2013
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/com/example/todolist/MainActivity.java
@@ -166,18 +166,17 @@ public String readJSON() throws FileNotFoundException, IOException {
try {
FileInputStream fis = openFileInput(FILENAME);
- fis.read();
- fis.close();
byte[] buffer = new byte[1024];
/* Reads a single byte from this stream and returns it as an integer
* in the range from 0 to 255. Returns -1 if the end of the stream
* has been reached. Blocks until one byte has been read, the end of
* the source stream is detected or an exception is thrown.
*/
- while ( (fis.read(buffer)) != -1 ) {
+ while ( fis.read(buffer) != -1 ) {
fileContent.append(new String(buffer));
- }
+ }
+ fis.close();
} catch (IOException e) {
// could be IOException or FileNotFoundException

0 comments on commit f0d18b8

Please sign in to comment.