public static class ObjectInserter.Formatter extends ObjectInserter
ObjectInserter.Filter, ObjectInserter.Formatter| Constructor and Description |
|---|
ObjectInserter.Formatter() |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Make all inserted objects visible.
|
ObjectId |
insert(int objectType,
long length,
InputStream in)
Insert a single object into the store, returning its unique name.
|
PackParser |
newPackParser(InputStream in)
Initialize a parser to read from a pack formatted stream.
|
ObjectReader |
newReader()
Open a reader for objects that may have been written by this inserter.
|
void |
release()
Release any resources used by this inserter.
|
public ObjectId insert(int objectType, long length, InputStream in) throws IOException
ObjectInserterinsert in class ObjectInserterobjectType - type code of the object to store.length - number of bytes to copy from in.in - stream providing the object content. The caller is responsible
for closing the stream.IOException - the object could not be stored, or the source stream could
not be read.public PackParser newPackParser(InputStream in) throws IOException
ObjectInserternewPackParser in class ObjectInserterin - the input stream. The stream is not closed by the parser, and
must instead be closed by the caller once parsing is complete.IOException - the parser instance, which can be configured and then used to
parse objects into the ObjectDatabase.public ObjectReader newReader()
ObjectInserter
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 this.newReader().newReader().
newReader in class ObjectInserterpublic void flush()
throws IOException
ObjectInserterThe flush may take some period of time to make the objects available to other threads.
flush in class ObjectInserterIOException - the flush could not be completed; objects inserted thus far
are in an indeterminate state.public void release()
ObjectInserterAn inserter that has been released can be used again, but may need to be released after the subsequent usage.
release in class ObjectInserterCopyright © 2014. All rights reserved.