Changeset 3239


Ignore:
Timestamp:
10/08/07 12:07:59 (12 years ago)
Author:
melissa
Message:

Fixed bug with >2GB files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/LIFReader.java

    r3197 r3239  
    149149      } 
    150150 
    151       int blockLength = in.readInt(); 
     151      long blockLength = in.readInt(); 
    152152      if (in.read() != 0x2a) { 
    153         in.skipBytes(3); 
     153        in.seek(in.getFilePointer() - 5); 
     154        blockLength = in.readLong(); 
    154155        if (in.read() != 0x2a) { 
    155156          throw new FormatException("Invalid Memory Description"); 
     
    163164        offsets.add(new Long(in.getFilePointer())); 
    164165      } 
    165  
    166       in.skipBytes(blockLength); 
     166      long skipped = 0; 
     167      while (skipped < blockLength) { 
     168        if (blockLength - skipped > 4096) { 
     169          skipped += in.skipBytes(4096); 
     170        } 
     171        else { 
     172          skipped += in.skipBytes((int) (blockLength - skipped)); 
     173        } 
     174      } 
    167175    } 
    168176    initMetadata(xml); 
Note: See TracChangeset for help on using the changeset viewer.