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()); 

```
From an answer I edited [here](https://stackoverflow.com/a/5445161/1599699):

```
static String convertStreamToString(java.io.InputStream is) {
    if (is == null) {
        return "";
    }

    java.util.Scanner s = new java.util.Scanner(is);
    s.useDelimiter("\\A");

    String streamString = s.hasNext() ? s.next() : "";

    s.close();

    return streamString;
}

```

This avoids all errors and works well.