Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
flush()Make all inserted objects visible.
insert(int objectType, long length, InputStream in)Insert a single object into the store, returning its unique name.
newPackParser(InputStream in)Initialize a parser to read from a pack formatted stream.
newReader()Open a reader for objects that may have been written by this inserter.
Methods inherited from class org.eclipse.jgit.lib.ObjectInserter
buffer, digest, idFor, idFor, idFor, idFor, insert, insert, insert, insert, insert
public ObjectId insert(int objectType, long length, InputStream in) throws IOExceptionInsert a single object into the store, returning its unique name.
- Specified by:
objectType- type code of the object to store.
length- number of bytes to copy from
in- stream providing the object content. The caller is responsible for closing the stream.
- the name of the object.
IOException- the object could not be stored, or the source stream could not be read.
public PackParser newPackParser(InputStream in) throws IOExceptionInitialize a parser to read from a pack formatted stream.
- Specified by:
in- the input stream. The stream is not closed by the parser, and must instead be closed by the caller once parsing is complete.
- the pack parser.
IOException- the parser instance, which can be configured and then used to parse objects into the ObjectDatabase.
public ObjectReader newReader()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
flush()to make them visible to the repository. The returned reader should only be used from the same thread as the inserter. Objects written by this inserter may not be visible to
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
ObjectStreamopened from this reader. For example, reading the remainder of the object may fail, or newly written data may even be corrupted. Interleaving whole object reads (including streaming reads) with inserts is fine, just not interleaving streaming partial object reads with inserts.
public void flush() throws IOExceptionMake all inserted objects visible.
The flush may take some period of time to make the objects available to other threads.