Changeset 5627


Ignore:
Timestamp:
10/21/09 09:07:20 (10 years ago)
Author:
melissa
Message:

Added debugging statement and more informative error messages.

File:
1 edited

Legend:

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

    r5517 r5627  
    287287 
    288288    while (in.getFilePointer() < in.length()) { 
    289       if (in.readInt() != LIF_MAGIC_BYTE) { 
    290         throw new FormatException("Invalid Memory Block"); 
     289      debug("Looking for a block at " + in.getFilePointer() + "; " + 
     290        offsets.size() + " blocks read"); 
     291      int check = in.readInt(); 
     292      if (check != LIF_MAGIC_BYTE) { 
     293        throw new FormatException("Invalid Memory Block: found magic bytes " + 
     294          check + ", expected " + LIF_MAGIC_BYTE); 
    291295      } 
    292296 
    293297      in.skipBytes(4); 
    294       if (in.read() != LIF_MEMORY_BYTE) { 
    295         throw new FormatException("Invalid Memory Description"); 
     298      check = in.read(); 
     299      if (check != LIF_MEMORY_BYTE) { 
     300        throw new FormatException("Invalid Memory Description: found magic " + 
     301          "byte " + check + ", expected " + LIF_MEMORY_BYTE); 
    296302      } 
    297303 
     
    300306        in.seek(in.getFilePointer() - 5); 
    301307        blockLength = in.readLong(); 
    302         if (in.read() != LIF_MEMORY_BYTE) { 
    303           throw new FormatException("Invalid Memory Description"); 
     308        check = in.read(); 
     309        if (check != LIF_MEMORY_BYTE) { 
     310          throw new FormatException("Invalid Memory Description: found magic " + 
     311            "byte " + check + ", expected " + LIF_MEMORY_BYTE); 
    304312        } 
    305313      } 
Note: See TracChangeset for help on using the changeset viewer.