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: 
Don't make the mistake of relying upon or needlessly converting/losing endline characters. Do it character by character. Don't forget to use the proper character encoding to interpres the stream.

```
public String getFileContent( FileInputStream fis ) {
    StringBuilder sb = new StringBuilder();
    Reader r = new InputStreamReader(fis, "UTF-8");  //or whatever encoding
    int ch = r.read();
    while(ch >= 0) {
        sb.append(ch);
        ch = r.read();
    }
    return sb.toString();
}

```

If you want to make this a little more efficient, you can use arrays of characters instead, but to be honest, looping over the characters can be still quite fast.

```
public String getFileContent( FileInputStream fis ) {
    StringBuilder sb = new StringBuilder();
    Reader r = new InputStreamReader(fis, "UTF-8");  //or whatever encoding
    char[] buf = new char[1024];
    int amt = r.read(buf);
    while(amt > 0) {
        sb.append(buf, 0, amt);
        amt = r.read(buf);
    }
    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.