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: 
```
public static String getFileContent(
   FileInputStream fis,
   String          encoding ) throws IOException
 {
   try( BufferedReader br =
           new BufferedReader( new InputStreamReader(fis, encoding )))
   {
      StringBuilder sb = new StringBuilder();
      String line;
      while(( line = br.readLine()) != null ) {
         sb.append( line );
         sb.append( '\n' );
      }
      return sb.toString();
   }
}

```
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.