Changeset 7141
- Timestamp:
- 10/27/10 21:31:32 (9 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1/components/bio-formats/src/loci/formats/in/PSDReader.java
r6767 r7141 272 272 } 273 273 } 274 while (in.read() != '8'); 275 in.skipBytes(7); 274 if (layerCount > 0) { 275 while (in.read() != '8'); 276 in.skipBytes(7); 277 } 276 278 int len = in.readInt(); 277 279 if ((len % 4) != 0) len += 4 - (len % 4); -
branches/4.1/components/common/src/loci/common/RandomAccessInputStream.java
r6919 r7141 421 421 /** Read a string of length n. */ 422 422 public String readString(int n) throws IOException { 423 int avail = available(); 424 if (n > avail) n = avail; 423 425 byte[] b = new byte[n]; 424 426 readFully(b); … … 453 455 /** Skip n bytes within the stream. */ 454 456 public int skipBytes(int n) throws IOException { 457 if (n < 0) return 0; 455 458 afp += n; 456 459 return n; … … 540 543 public int available() throws IOException { 541 544 if (Boolean.FALSE.equals(fileCache.get(this))) reopen(); 542 int available = dis != null ? dis.available() + ext : 543 (int) (length() - getFilePointer()); 544 if (available < 0) available = Integer.MAX_VALUE; 545 return available; 545 long remain = length() - getFilePointer(); 546 if (remain > Integer.MAX_VALUE) remain = Integer.MAX_VALUE; 547 return (int) remain; 546 548 } 547 549 -
branches/4.2/components/bio-formats/src/loci/formats/in/PSDReader.java
r7007 r7141 269 269 } 270 270 } 271 while (in.read() != '8'); 272 in.skipBytes(7); 271 if (layerCount > 0) { 272 while (in.read() != '8'); 273 in.skipBytes(7); 274 } 273 275 int len = in.readInt(); 274 276 if ((len % 4) != 0) len += 4 - (len % 4); -
trunk/components/bio-formats/src/loci/formats/in/PSDReader.java
r6881 r7141 269 269 } 270 270 } 271 while (in.read() != '8'); 272 in.skipBytes(7); 271 if (layerCount > 0) { 272 while (in.read() != '8'); 273 in.skipBytes(7); 274 } 273 275 int len = in.readInt(); 274 276 if ((len % 4) != 0) len += 4 - (len % 4);
Note: See TracChangeset
for help on using the changeset viewer.