ObjectDirectory.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final WriteConfig | |
| private final FileObjectDatabase | |
| private Deflater |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| pack-priv DeflaterOutputStream | |
| public void | flush()
Implements abstract org. Make all inserted objects visible. |
| public ObjectId | insert(int
type code of the object to store. type, byte[] complete content of the object. data, int first position within off, int data.number of bytes to copy from len)data.Overrides org. Insert a single object into the store, returning its unique name. |
| private ObjectId | Returns: ObjectId the name of the objectobject type type, byte[] object data data, int first position within @{code data} off, int length number of bytes to copy len, boolean whether to insert a duplicate if an object with this id
already exists createDuplicate)Insert a loose object into the database. |
| public ObjectId | insert(int
type code of the object to store. type, long number of bytes to copy from len, InputStream in.stream providing the object content. The caller is responsible
for closing the stream. is)Implements abstract org. Insert a single object into the store, returning its unique name. |
| pack-priv ObjectId | Returns: ObjectId the name of the objectobject type type, long number of bytes to copy len, InputStream input stream is, boolean whether to insert a duplicate if an object with this id
already exists createDuplicate)Insert a loose object into the database. |
| private ObjectId | |
| public PackParser | newPackParser(InputStream
the input stream. The stream is not closed by the parser, and
must instead be closed by the caller once parsing is complete. in)Implements abstract org. Initialize a parser to read from a pack formatted stream. |
| public ObjectReader | newReader()
Implements abstract org. Open a reader for objects that may have been written by this inserter. |
| pack-priv File | |
| private static EOFException | |
| private File | |
| private File | |
| pack-priv void |
| config | back to summary |
|---|---|
| private final WriteConfig config | |
| db | back to summary |
|---|---|
| private final FileObjectDatabase db | |
| deflate | back to summary |
|---|---|
| private Deflater deflate | |
| ObjectDirectoryInserter | back to summary |
|---|---|
| pack-priv ObjectDirectoryInserter(FileObjectDatabase dest, Config cfg) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Release any resources used by this inserter. An inserter that has been released can be used again, but may need to be released after the subsequent usage.
| |
| compress | back to summary |
|---|---|
| pack-priv DeflaterOutputStream compress(OutputStream out) | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract org. Doc from org. Make all inserted objects visible. The flush may take some period of time to make the objects available to other threads.
| |
| insert | back to summary |
|---|---|
| public ObjectId insert(int type, byte[] data, int off, int len) throws IOException Overrides org. Doc from org. Insert a single object into the store, returning its unique name.
| |
| insert | back to summary |
|---|---|
| private ObjectId insert(int type, byte[] data, int off, int len, boolean createDuplicate) throws IOException Insert a loose object into the database. If createDuplicate is true, write the loose object even if we already have it in the loose or packed ODB.
| |
| insert | back to summary |
|---|---|
| public ObjectId insert(int type, long len, InputStream is) throws IOException Implements abstract org. Doc from org. Insert a single object into the store, returning its unique name.
| |
| insert | back to summary |
|---|---|
| pack-priv ObjectId insert(int type, long len, InputStream is, boolean createDuplicate) throws IOException Insert a loose object into the database. If createDuplicate is true, write the loose object even if we already have it in the loose or packed ODB.
| |
| insertOneObject | back to summary |
|---|---|
| private ObjectId insertOneObject(File tmp, ObjectId id, boolean createDuplicate) throws IOException | |
| newPackParser | back to summary |
|---|---|
| public PackParser newPackParser(InputStream in) throws IOException Implements abstract org. Doc from org. Initialize a parser to read from a pack formatted stream.
| |
| newReader | back to summary |
|---|---|
| public ObjectReader newReader() Implements abstract org. Doc from org. Open a reader for objects that may have been written by this inserter.
The returned reader allows the calling thread to read back recently
inserted objects without first calling
The returned reader should return this inserter instance from
Behavior is undefined if an insert method is called on the inserter in the
middle of reading from an
| |
| newTempFile | back to summary |
|---|---|
| pack-priv File newTempFile() throws IOException | |
| shortInput | back to summary |
|---|---|
| private static EOFException shortInput(long missing) | |
| toTemp | back to summary |
|---|---|
| private File toTemp(final SHA1 md, final int type, long len, final InputStream is) throws IOException | |
| toTemp | back to summary |
|---|---|
| private File toTemp(final int type, final byte[] buf, final int pos, final int len) throws IOException | |
| writeHeader | back to summary |
|---|---|
| pack-priv void writeHeader(OutputStream out, int type, long len) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private final SHA1 |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | write(int
the b)byte.Overrides java. Writes the specified |
| public void | write(byte[]
the data. in, int the start offset in the data. p, int the number of bytes to write. n)Overrides java. Writes |
| md | back to summary |
|---|---|
| private final SHA1 md | |
| SHA1OutputStream | back to summary |
|---|---|
| pack-priv SHA1OutputStream(OutputStream out, SHA1 md) | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Overrides java. Doc from java. Writes the specified
The
Implements the abstract
| |
| write | back to summary |
|---|---|
| public void write(byte[] in, int p, int n) throws IOException Overrides java. Doc from java. Writes
| |