Changeset 6030


Ignore:
Timestamp:
03/16/10 15:26:19 (10 years ago)
Author:
melissa
Message:

Fixed a couple of bugs with reading > 2 GB ICS datasets.

Location:
trunk/components
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/ICSReader.java

    r6026 r6030  
    219219    int[] prevCoordinates = getZCTCoords(prevImage); 
    220220 
    221     in.seek(offset + no * len); 
     221    in.seek(offset + no * (long) len); 
    222222 
    223223    int sizeC = lifetime ? 1 : getSizeC(); 
     
    226226      // channels are stored interleaved, but because there are more than we 
    227227      // can display as RGB, we need to separate them 
    228       in.seek(offset + len * getIndex(coordinates[0], 0, coordinates[2])); 
     228      in.seek(offset + 
     229        (long) len * getIndex(coordinates[0], 0, coordinates[2])); 
    229230      if (!gzip && data == null) { 
    230231        data = new byte[len * getSizeC()]; 
  • trunk/components/common/src/loci/common/RandomAccessInputStream.java

    r6026 r6030  
    220220    } 
    221221 
     222    // ensure that we don't try to read more bytes than are in the file 
     223    if (blockSize > maxLen / 2) { 
     224      blockSize = (int) (maxLen / 2); 
     225    } 
     226 
    222227    InputStreamReader in = new InputStreamReader(this); 
    223228    char[] buf = new char[blockSize]; 
Note: See TracChangeset for help on using the changeset viewer.