Changeset 3853


Ignore:
Timestamp:
03/28/08 13:29:20 (12 years ago)
Author:
melissa
Message:

Make sure temporary RandomAccessStreams get closed.

Location:
trunk/loci/formats/codec
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/codec/BaseCodec.java

    r3279 r3853  
    164164  { 
    165165    try { 
    166       return decompress(new RandomAccessStream(data), options); 
     166      RandomAccessStream s = new RandomAccessStream(data); 
     167      byte[] b = decompress(s, options); 
     168      s.close(); 
     169      return b; 
    167170    } 
    168171    catch (IOException exc) { 
  • trunk/loci/formats/codec/JPEGCodec.java

    r3524 r3853  
    9090      if (r == null) throw new IOException(""); 
    9191 
    92       r.setInput(ImageIO.createImageInputStream(new BufferedInputStream(in))); 
     92      ImageInputStream ii = 
     93        ImageIO.createImageInputStream(new BufferedInputStream(in)); 
     94      r.setInput(ii); 
    9395      b = r.read(0); 
     96      ii.close(); 
     97      r.dispose(); 
    9498    } 
    9599    catch (IOException exc) { 
     
    114118        r.setInput(ii); 
    115119        b = r.read(0); 
     120        ii.close(); 
     121        r.dispose(); 
    116122      } 
    117123      catch (IOException e) { 
  • trunk/loci/formats/codec/MJPBCodec.java

    r3658 r3853  
    195195      } 
    196196 
     197      ras.close(); 
     198 
    197199      if (raw == null) raw = data; 
    198200 
Note: See TracChangeset for help on using the changeset viewer.