Question: If I want to move a rectangle in a Canvas, would I have to modify the Top and Left properties? Thats the only way I see it would be possible. I am making a tile-based game, and the rectangles I want to move are filled with images of enemies and my hero.

Answer: 
Using Apache commons IOUtils function

```
import org.apache.commons.io.IOUtils;

InputStream inStream = new FileInputStream("filename.txt");
String body = IOUtils.toString(inStream, StandardCharsets.UTF_8.name()); 

```
Use following code ---->

```
try {
    FileInputStream fis=new FileInputStream("filename.txt");
    int i=0;    
    while((i = fis.read()) !=-1 ) {  // to reach until the laste bytecode -1
        System.out.print((char)i);   /* For converting each bytecode into character */ 
    }
    fis.close();
} catch(Exception ex) {
    System.out.println(ex); 
}

```