java.lang.Object
org.eclipse.jgit.internal.storage.midx.MultiPackIndexLoader
The loader returns the representation of the MultiPackIndex file content.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThrown when a MultiPackIndex file's format is different from we expected -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiPackIndexOpen an existing MultiPackIndex file for reading.static MultiPackIndexread(InputStream fd) Read an existing MultiPackIndex file from a buffered stream.
-
Constructor Details
-
MultiPackIndexLoader
public MultiPackIndexLoader()
-
-
Method Details
-
open
public static MultiPackIndex open(File midxFile) throws FileNotFoundException, MultiPackIndexLoader.MultiPackIndexFormatException, IOException Open an existing MultiPackIndex file for reading.The format of the file will be automatically detected and a proper access implementation for that format will be constructed and returned to the caller. The file may or may not be held open by the returned instance.
- Parameters:
midxFile- existing multi-pack-index to read.- Returns:
- a copy of the multi-pack-index file in memory
- Throws:
FileNotFoundException- the file does not exist.MultiPackIndexLoader.MultiPackIndexFormatException- MultiPackIndex file's format is different from we expected.IOException- the file exists but could not be read due to security errors or unexpected data corruption.
-
read
public static MultiPackIndex read(InputStream fd) throws MultiPackIndexLoader.MultiPackIndexFormatException, IOException Read an existing MultiPackIndex file from a buffered stream.The format of the file will be automatically detected and a proper access implementation for that format will be constructed and returned to the caller. The file may or may not be held open by the returned instance.
- Parameters:
fd- stream to read the multipack-index file from. The stream must be buffered as some small IOs are performed against the stream. The caller is responsible for closing the stream.- Returns:
- a copy of the MultiPackIndex file in memory
- Throws:
MultiPackIndexLoader.MultiPackIndexFormatException- the MultiPackIndex file's format is different from we expected.IOException- the stream cannot be read.
-