private class PackInserter.Reader.StreamLoader extends ObjectLoader
ObjectLoader.Filter, ObjectLoader.SmallObject
Modifier and Type | Field and Description |
---|---|
private long |
pos |
private long |
size |
private int |
type |
Constructor and Description |
---|
StreamLoader(int type,
long size,
long pos) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getCachedBytes()
Obtain a reference to the (possibly cached) bytes of this object.
|
long |
getSize()
Get size of object in bytes
|
int |
getType()
Get Git in pack object type
|
ObjectStream |
openStream()
Obtain an input stream to read this object's data.
|
copyTo, getBytes, getBytes, getCachedBytes, isLarge
public ObjectStream openStream() throws MissingObjectException, java.io.IOException
ObjectLoader
openStream
in class ObjectLoader
MissingObjectException
- the object no longer exists.java.io.IOException
- the object store cannot be accessed.public int getType()
ObjectLoader
getType
in class ObjectLoader
Constants
.public long getSize()
ObjectLoader
getSize
in class ObjectLoader
public byte[] getCachedBytes() throws LargeObjectException
ObjectLoader
This method offers direct access to the internal caches, potentially saving on data copies between the internal cache and higher level code. Callers who receive this reference must not modify its contents. Changes (if made) will affect the cache but not the repository itself.
getCachedBytes
in class ObjectLoader
LargeObjectException
- if the object won't fit into a byte array, because
ObjectLoader.isLarge()
returns true. Callers should use
ObjectLoader.openStream()
instead to access the contents.