public static class ObjectLoader.SmallObject extends ObjectLoader
ObjectReader implementations can use this stream type when the object's content is small enough to be accessed as a single byte array.
ObjectLoader.Filter, ObjectLoader.SmallObject| Constructor and Description |
|---|
SmallObject(int type,
byte[] data)
Construct a small object loader.
|
| 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
|
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, getCachedBytespublic SmallObject(int type,
byte[] data)
type - type of the object.data - the object's data array. This array will be returned as-is
for the getCachedBytes() method.public int getType()
ObjectLoadergetType in class ObjectLoaderConstants.public long getSize()
ObjectLoadergetSize in class ObjectLoaderpublic boolean isLarge()
ObjectLoaderisLarge in class ObjectLoaderObjectLoader.openStream() to prevent overflowing the JVM heap.public byte[] getCachedBytes()
ObjectLoaderThis 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 ObjectLoaderpublic ObjectStream openStream()
ObjectLoaderopenStream in class ObjectLoaderCopyright © 2019 Eclipse JGit Project. All rights reserved.