The proper way to close out/inputstreams is the following:

```java
OutputStream os = null;
try {
    os = new FileOutputStream(...);
    ...
} catch ( IOException e ){
    // ... Treat the exception
} finally {
    if ( os != null ){
        try {
            os.close();
        } catch (Exception e){
        }
    }
}
```
otherwise, if some exception occurs, you might leave some streams opened.