public class LfsBlobLoader extends ObjectLoader
ObjectLoader implementation that reads a media file from the LFS
storage.ObjectLoader.Filter, ObjectLoader.SmallObject| Constructor and Description |
|---|
LfsBlobLoader(Path mediaFile)
Create a loader for the LFS media file at the given path.
|
| 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, isLargepublic LfsBlobLoader(Path mediaFile) throws IOException
mediaFile - path to the fileIOException - in case of an error reading attributespublic int getType()
ObjectLoadergetType in class ObjectLoaderConstants.public long getSize()
ObjectLoadergetSize in class ObjectLoaderpublic byte[] getCachedBytes()
throws LargeObjectException
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 ObjectLoaderLargeObjectException - 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, IOException
ObjectLoaderopenStream in class ObjectLoaderMissingObjectException - the object no longer exists.IOException - the object store cannot be accessed.Copyright © 2019 Eclipse JGit Project. All rights reserved.