Package org.eclipse.jgit.internal.storage.dfs

## Class DfsPackFile

- java.lang.Object
- - org.eclipse.jgit.internal.storage.dfs.DfsPackFile

    public final class DfsPackFile
    extends Object

A Git version 2 pack file representation. A pack file contains Git objects in delta packed format yielding high compression of lots of object where some objects are similar.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Release all memory used by this DfsPackFile instance.
`long` `getCachedSize()`
`DfsPackDescription` `getPackDescription()`
`boolean` `hasObject​(DfsReader ctx, AnyObjectId id)` Check if an object is stored within this pack.
`boolean` `isIndexLoaded()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getPackDescription

    public DfsPackDescription getPackDescription()

Returns:
  description that was originally used to configure this pack file.

#### isIndexLoaded

    public boolean isIndexLoaded()

Returns:
  whether the pack index file is loaded and cached in memory.
Since:
  2.2

#### getCachedSize

    public long getCachedSize()

Returns:
  bytes cached in memory for this pack, excluding the index.

#### hasObject

    public boolean hasObject​(DfsReader ctx,
                             AnyObjectId id)
                      throws IOException

Check if an object is stored within this pack.

Parameters:
  `ctx` - reader context to support reading from the backing store if the index is not already loaded in memory.
  `id` - object to be located.
Returns:
  true if the object exists in this pack; false if it does not.
Throws:
  `IOException` - the pack index is not available, or is corrupt.

#### close

    public void close()

Release all memory used by this DfsPackFile instance.