Close files when we open them. Could be the cause of many problems.
- M jbidwatcher/trunk/src/com/jbidwatcher/util/ByteBuffer.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/util/IconFactory.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/util/config/JConfig.java view
| 355 | 595 | |
|---|---|---|
| 42 | 42 | try { |
| 43 | 43 | FileOutputStream fos = new FileOutputStream(fp); |
| 44 | 44 | fos.write(data, 0, length); |
| 45 | fos.close(); | |
| 45 | 46 | } catch(IOException ioe) { |
| 46 | 47 | ErrorManagement.handleException("Error writing " + fileName, ioe); |
| 47 | 48 | } |
| 548 | 595 | |
|---|---|---|
| 146 | 146 | try { |
| 147 | 147 | FileOutputStream fos = new FileOutputStream(outFile); |
| 148 | 148 | ImageIO.write(createResizedCopy(image, new_x, new_y, true), "jpeg", fos); |
| 149 | fos.close(); | |
| 149 | 150 | } catch (FileNotFoundException e) { |
| 150 | 151 | ErrorManagement.handleException("Can't write " + outFile + " to create thumbnail.", e); |
| 151 | 152 | return false; |
| 579 | 595 | |
|---|---|---|
| 318 | 318 | if(mAuxProps != null) { |
| 319 | 319 | mAuxProps.store(fos, "Search display information. Do not modify while running."); |
| 320 | 320 | } |
| 321 | fos.close(); | |
| 321 | 322 | } catch(IOException e) { |
| 322 | 323 | // D'oh. It failed to write the display information... |
| 323 | 324 | ErrorManagement.handleException("Failed to write display configuration.", e); |
