From: <ga...@us...> - 2008-05-30 15:28:21
|
Revision: 4158 http://jnode.svn.sourceforge.net/jnode/?rev=4158&view=rev Author: galatnm Date: 2008-05-30 08:28:17 -0700 (Fri, 30 May 2008) Log Message: ----------- Fix if data fork has more than one extend. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusFile.java Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusFile.java 2008-05-30 14:55:37 UTC (rev 4157) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HFSPlusFile.java 2008-05-30 15:28:17 UTC (rev 4158) @@ -33,10 +33,11 @@ @Override public final void read(final long fileOffset, final ByteBuffer dest) throws IOException { HfsPlusFileSystem fs = (HfsPlusFileSystem)getFileSystem(); - ExtentDescriptor d = file.getDataFork().getExtents()[0]; - if(d.getStartBlock() != 0 && d.getBlockCount() != 0){ - long firstOffset = d.getStartBlock()*fs.getVolumeHeader().getBlockSize(); - fs.getApi().read(firstOffset, dest); + for(ExtentDescriptor d: file.getDataFork().getExtents()){ + if(d.getStartBlock() != 0 && d.getBlockCount() != 0){ + long firstOffset = d.getStartBlock()*fs.getVolumeHeader().getBlockSize(); + fs.getApi().read(firstOffset, dest); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |