Changeset 1361


Ignore:
Timestamp:
08/25/06 15:16:30 (14 years ago)
Author:
curtis
Message:

Use DataInputStream.readFully instead of looped read, for simplicity
(no significant performance difference, though).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatReader.java

    r1358 r1361  
    144144    byte[] buf = new byte[len < maxLen ? (int) len : maxLen]; 
    145145    try { 
    146       FileInputStream fin = new FileInputStream(name); 
    147       int r = 0; 
    148       while (r < buf.length) r += fin.read(buf, r, buf.length - r); 
     146      DataInputStream fin = new DataInputStream(new FileInputStream(name)); 
     147      fin.readFully(buf); 
    149148      fin.close(); 
    150149      return isThisType(buf); 
Note: See TracChangeset for help on using the changeset viewer.