Class LfsBlobLoader

  • public class LfsBlobLoader
    extends ObjectLoader
    An ObjectLoader implementation that reads a media file from the LFS storage.
    • Constructor Detail

      • LfsBlobLoader

        public LfsBlobLoader​(Path mediaFile)
                      throws IOException
        Create a loader for the LFS media file at the given path.
        mediaFile - path to the file
        IOException - in case of an error reading attributes
    • Method Detail

      • getType

        public int getType()
        Description copied from class: ObjectLoader
        Get Git in pack object type
        Specified by:
        getType in class ObjectLoader
        Git in pack object type, see Constants.
      • getSize

        public long getSize()
        Description copied from class: ObjectLoader
        Get size of object in bytes
        Specified by:
        getSize in class ObjectLoader
        size of object in bytes
      • getCachedBytes

        public byte[] getCachedBytes()
                              throws LargeObjectException
        Description copied from class: ObjectLoader
        Obtain a reference to the (possibly cached) bytes of this object.

        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.

        Specified by:
        getCachedBytes in class ObjectLoader
        the cached bytes of this object. Do not modify it.
        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.