int getOffset() { return info.getOffset(); }
int getOffset() { return info.getOffset(); }
public ObjectLoader open() throws IOException { ChunkKey chunkKey = current.chunkKey; // Objects returned by the queue are clustered by chunk. This object // is either in the current chunk, or are the next chunk ready on the // prefetcher. Anything else is a programming error. // PackChunk chunk; if (currChunk != null && chunkKey.equals(currChunk.getChunkKey())) chunk = currChunk; else { chunk = prefetcher.get(chunkKey); if (chunk == null) throw new DhtMissingChunkException(chunkKey); currChunk = chunk; reader.recentChunk(chunk); } if (current.info != null) { int ptr = current.info.getOffset(); int type = current.info.getType(); return PackChunk.read(chunk, ptr, reader, type); } else { int ptr = chunk.findOffset(repo, current.object); if (ptr < 0) throw DhtReader.missing(current.object, ObjectReader.OBJ_ANY); return PackChunk.read(chunk, ptr, reader, ObjectReader.OBJ_ANY); } }
public ObjectLoader open() throws IOException { ChunkKey chunkKey = current.chunkKey; // Objects returned by the queue are clustered by chunk. This object // is either in the current chunk, or are the next chunk ready on the // prefetcher. Anything else is a programming error. // PackChunk chunk; if (currChunk != null && chunkKey.equals(currChunk.getChunkKey())) chunk = currChunk; else { chunk = prefetcher.get(chunkKey); if (chunk == null) throw new DhtMissingChunkException(chunkKey); currChunk = chunk; reader.recentChunk(chunk); } if (current.info != null) { int ptr = current.info.getOffset(); int type = current.info.getType(); return PackChunk.read(chunk, ptr, reader, type); } else { int ptr = chunk.findOffset(repo, current.object); if (ptr < 0) throw DhtReader.missing(current.object, ObjectReader.OBJ_ANY); return PackChunk.read(chunk, ptr, reader, ObjectReader.OBJ_ANY); } }
return new ChunkAndOffset(chunk, link.getOffset());
return new ChunkAndOffset(chunk, link.getOffset());