class LargePackedWholeObject extends ObjectLoader
ObjectLoader.Filter, ObjectLoader.SmallObject
Modifier and Type | Field and Description |
---|---|
private FileObjectDatabase |
db |
private int |
headerLength |
private long |
objectOffset |
private PackFile |
pack |
private long |
size |
private int |
type |
Constructor and Description |
---|
LargePackedWholeObject(int type,
long size,
long objectOffset,
int headerLength,
PackFile pack,
FileObjectDatabase db) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getCachedBytes()
Obtain a reference to the (possibly cached) bytes of this object.
|
private ObjectId |
getObjectId() |
long |
getSize()
Get size of object in bytes
|
int |
getType()
Get Git in pack object type
|
boolean |
isLarge()
Whether this object is too large to obtain as a byte array.
|
ObjectStream |
openStream()
Obtain an input stream to read this object's data.
|
copyTo, getBytes, getBytes, getCachedBytes
private final int type
private final long size
private final long objectOffset
private final int headerLength
private final PackFile pack
private final FileObjectDatabase db
LargePackedWholeObject(int type, long size, long objectOffset, int headerLength, PackFile pack, FileObjectDatabase db)
public int getType()
getType
in class ObjectLoader
Constants
.public long getSize()
getSize
in class ObjectLoader
public boolean isLarge()
isLarge
in class ObjectLoader
ObjectLoader.openStream()
to prevent overflowing the JVM heap.public byte[] getCachedBytes() throws LargeObjectException
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.public ObjectStream openStream() throws MissingObjectException, java.io.IOException
openStream
in class ObjectLoader
MissingObjectException
- the object no longer exists.java.io.IOException
- the object store cannot be accessed.private ObjectId getObjectId() throws java.io.IOException
java.io.IOException