private void seekToDId(final int pDId) throws IOException { if (directorySIdChain == null) { directorySIdChain = getSIdChain(directorySId, FREE_SID); } int dIdsPerSId = sectorSize / Entry.LENGTH; int sIdOffset = pDId / dIdsPerSId; int dIdOffset = pDId - (sIdOffset * dIdsPerSId); int sId = directorySIdChain.get(sIdOffset); seekToSId(sId, FREE_SID); if (input instanceof LittleEndianRandomAccessFile) { LittleEndianRandomAccessFile input = (LittleEndianRandomAccessFile) this.input; input.seek(input.getFilePointer() + dIdOffset * Entry.LENGTH); } else if (input instanceof ImageInputStream) { ImageInputStream input = (ImageInputStream) this.input; input.seek(input.getStreamPosition() + dIdOffset * Entry.LENGTH); } else { SeekableLittleEndianDataInputStream input = (SeekableLittleEndianDataInputStream) this.input; input.seek(input.getStreamPosition() + dIdOffset * Entry.LENGTH); } }
private void seekToDId(final int pDId) throws IOException { if (mDirectorySIdChain == null) { mDirectorySIdChain = getSIdChain(mDirectorySId, FREE_SID); } int dIdsPerSId = mSectorSize / Entry.LENGTH; int sIdOffset = pDId / dIdsPerSId; int dIdOffset = pDId - (sIdOffset * dIdsPerSId); int sId = mDirectorySIdChain.get(sIdOffset); seekToSId(sId, FREE_SID); if (mInput instanceof LittleEndianRandomAccessFile) { LittleEndianRandomAccessFile input = (LittleEndianRandomAccessFile) mInput; input.seek(input.getFilePointer() + dIdOffset * Entry.LENGTH); } else if (mInput instanceof ImageInputStream) { ImageInputStream input = (ImageInputStream) mInput; input.seek(input.getStreamPosition() + dIdOffset * Entry.LENGTH); } else { SeekableLittleEndianDataInputStream input = (SeekableLittleEndianDataInputStream) mInput; input.seek(input.getStreamPosition() + dIdOffset * Entry.LENGTH); } }
private void seekToDId(final int pDId) throws IOException { if (directorySIdChain == null) { directorySIdChain = getSIdChain(directorySId, FREE_SID); } int dIdsPerSId = sectorSize / Entry.LENGTH; int sIdOffset = pDId / dIdsPerSId; int dIdOffset = pDId - (sIdOffset * dIdsPerSId); int sId = directorySIdChain.get(sIdOffset); seekToSId(sId, FREE_SID); if (input instanceof LittleEndianRandomAccessFile) { LittleEndianRandomAccessFile input = (LittleEndianRandomAccessFile) this.input; input.seek(input.getFilePointer() + dIdOffset * Entry.LENGTH); } else if (input instanceof ImageInputStream) { ImageInputStream input = (ImageInputStream) this.input; input.seek(input.getStreamPosition() + dIdOffset * Entry.LENGTH); } else { SeekableLittleEndianDataInputStream input = (SeekableLittleEndianDataInputStream) this.input; input.seek(input.getStreamPosition() + dIdOffset * Entry.LENGTH); } }