Top Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

pack-priv Class LargePackedWholeObject

extends ObjectLoader
Class Inheritance
Imports
java.io.BufferedInputStream, .IOException, .InputStream, java.util.zip.InflaterInputStream, org.eclipse.jgit.errors.LargeObjectException, .MissingObjectException, org.eclipse.jgit.lib.ObjectId, .ObjectLoader, .ObjectStream

Field Summary

Modifier and TypeField and Description
private final FileObjectDatabase
private final int
private final long
private final Pack
private final long
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
LargePackedWholeObject(int type, long size, long objectOffset, int headerLength, Pack pack, FileObjectDatabase db)

Method Summary

Modifier and TypeMethod and Description
public byte[]
getCachedBytes()

Implements abstract org.eclipse.jgit.lib.ObjectLoader.getCachedBytes.

Obtain a reference to the (possibly cached) bytes of this object.

private ObjectId
public long
getSize()

Implements abstract org.eclipse.jgit.lib.ObjectLoader.getSize.

Get size of object in bytes

public int
getType()

Implements abstract org.eclipse.jgit.lib.ObjectLoader.getType.

Get Git in pack object type

public boolean
isLarge()

Overrides org.eclipse.jgit.lib.ObjectLoader.isLarge.

Whether this object is too large to obtain as a byte array.

public ObjectStream
openStream()

Implements abstract org.eclipse.jgit.lib.ObjectLoader.openStream.

Obtain an input stream to read this object's data.

Inherited from org.eclipse.jgit.lib.ObjectLoader:
copyTogetBytesgetBytesgetCachedBytes

Field Detail

dbback to summary
private final FileObjectDatabase db
headerLengthback to summary
private final int headerLength
objectOffsetback to summary
private final long objectOffset
packback to summary
private final Pack pack
sizeback to summary
private final long size
typeback to summary
private final int type

Constructor Detail

LargePackedWholeObjectback to summary
pack-priv LargePackedWholeObject(int type, long size, long objectOffset, int headerLength, Pack pack, FileObjectDatabase db)

Method Detail

getCachedBytesback to summary
public byte[] getCachedBytes() throws LargeObjectException

Implements abstract org.eclipse.jgit.lib.ObjectLoader.getCachedBytes.

Doc from org.eclipse.jgit.lib.ObjectLoader.getCachedBytes.

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.

Returns:byte[]

the cached bytes of this object. Do not modify it.

Annotations
@Override
Exceptions
LargeObjectException:
if the object won't fit into a byte array, because isLarge() returns true. Callers should use openStream() instead to access the contents.
getObjectIdback to summary
private ObjectId getObjectId() throws IOException
getSizeback to summary
public long getSize()

Implements abstract org.eclipse.jgit.lib.ObjectLoader.getSize.

Doc from org.eclipse.jgit.lib.ObjectLoader.getSize.

Get size of object in bytes

Returns:long

size of object in bytes

Annotations
@Override
getTypeback to summary
public int getType()

Implements abstract org.eclipse.jgit.lib.ObjectLoader.getType.

Doc from org.eclipse.jgit.lib.ObjectLoader.getType.

Get Git in pack object type

Returns:int

Git in pack object type, see org.eclipse.jgit.lib.Constants.

Annotations
@Override
isLargeback to summary
public boolean isLarge()

Overrides org.eclipse.jgit.lib.ObjectLoader.isLarge.

Doc from org.eclipse.jgit.lib.ObjectLoader.isLarge.

Whether this object is too large to obtain as a byte array.

Returns:boolean

true if this object is too large to obtain as a byte array. Objects over a certain threshold should be accessed only by their openStream() to prevent overflowing the JVM heap.

Annotations
@Override
openStreamback to summary
public ObjectStream openStream() throws MissingObjectException, IOException

Implements abstract org.eclipse.jgit.lib.ObjectLoader.openStream.

Doc from org.eclipse.jgit.lib.ObjectLoader.openStream.

Obtain an input stream to read this object's data.

Returns:ObjectStream

a stream of this object's data. Caller must close the stream when through with it. The returned stream is buffered with a reasonable buffer size.

Annotations
@Override
Exceptions
MissingObjectException:
the object no longer exists.
IOException:
the object store cannot be accessed.