@Override protected CompoundDocument.SeekableLittleEndianDataInputStream makeInputStream(byte[] pBytes) { return new CompoundDocument.SeekableLittleEndianDataInputStream(new MemoryCacheSeekableStream(new ByteArrayInputStream(pBytes))); }
((SeekableLittleEndianDataInputStream) input).seek(pos);
((SeekableLittleEndianDataInputStream) mInput).seek(pos);
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); } }
@Override protected CompoundDocument.SeekableLittleEndianDataInputStream makeInputStream(byte[] pBytes) { return new CompoundDocument.SeekableLittleEndianDataInputStream(new MemoryCacheSeekableStream(new ByteArrayInputStream(pBytes))); }
CompoundDocument(final SeekableInputStream pInput) throws IOException { input = new SeekableLittleEndianDataInputStream(pInput); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
CompoundDocument(final SeekableInputStream pInput) throws IOException { mInput = new SeekableLittleEndianDataInputStream(pInput); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }
((SeekableLittleEndianDataInputStream) input).seek(pos);
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); } }
CompoundDocument(final SeekableInputStream stream) throws IOException { input = new SeekableLittleEndianDataInputStream(stream); // TODO: Might be better to read header on first read operation?! // OTOH: It's also good to be fail-fast, so at least we should make // sure we're reading a valid document readHeader(); }