| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | ObjectLoader.
Wraps a delegate ObjectLoader. |
| public static class | ObjectLoader.
Simple loader around the cached byte array. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static byte[] | |
| public void | copyTo(OutputStream
stream to receive the complete copy of this object's data.
Caller is responsible for flushing or closing this stream
after this method returns. out)Copy this object to the output stream. |
| public final byte[] | |
| public final byte[] | Returns: the bytes of this object.maximum number of bytes to return. If the object is larger
than this limit,
sizeLimit)org. will be
thrown.Obtain a copy of the bytes of this object. |
| public abstract byte[] | Returns: the cached bytes of this object. Do not modify it.Obtain a reference to the (possibly cached) bytes of this object. |
| public byte[] | Returns: the cached bytes of this object. Do not modify it.maximum number of bytes to return. If the object size is
larger than this limit and sizeLimit)isLarge() is true,
org. will be
thrown.Obtain a reference to the (possibly cached) bytes of this object. |
| public abstract long | |
| public abstract int | Returns: Git in pack object type, seeorg..Get Git in pack object type |
| public boolean | Returns: true if this object is too large to obtain as a byte array. Objects over a certain threshold should be accessed only by theiropenStream() to prevent overflowing the JVM heap.Whether this object is too large to obtain as a byte array. |
| public abstract ObjectStream | Returns: 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.Obtain an input stream to read this object's data. |
| ObjectLoader | back to summary |
|---|---|
| public ObjectLoader() | |
| cloneArray | back to summary |
|---|---|
| private static byte[] cloneArray(byte[] data) | |
| copyTo | back to summary |
|---|---|
| public void copyTo(OutputStream out) throws MissingObjectException, IOException Copy this object to the output stream.
For some object store implementations, this method may be more efficient
than reading from The default implementation of this method is to copy with a temporary byte array for large objects, or to pass through the cached byte array for small objects.
| |
| getBytes | back to summary |
|---|---|
| public final byte[] getBytes() throws LargeObjectException Obtain a copy of the bytes of this object.
Unlike
| |
| getBytes | back to summary |
|---|---|
| public final byte[] getBytes(int sizeLimit) throws LargeObjectException, MissingObjectException, IOException Obtain a copy of the bytes of this object.
If the object size is less than or equal to
| |
| getCachedBytes | back to summary |
|---|---|
| public abstract byte[] getCachedBytes() throws LargeObjectException 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.
| |
| getCachedBytes | back to summary |
|---|---|
| public byte[] getCachedBytes(int sizeLimit) throws LargeObjectException, MissingObjectException, IOException Obtain a reference to the (possibly cached) bytes of this object.
If the object size is less than or equal to
| |
| getSize | back to summary |
|---|---|
| public abstract long getSize() Get size of object in bytes
| |
| getType | back to summary |
|---|---|
| public abstract int getType() Get Git in pack object type
| |
| isLarge | back to summary |
|---|---|
| public boolean isLarge() Whether this object is too large to obtain as a byte array.
| |
| openStream | back to summary |
|---|---|
| public abstract ObjectStream openStream() throws MissingObjectException, IOException Obtain an input stream to read this object's data.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract ObjectLoader | Returns: delegate ObjectLoader to handle all processing.Get delegate ObjectLoader to handle all processing. |
| public byte[] | getCachedBytes()
Implements abstract org. Obtain a reference to the (possibly cached) bytes of this object. |
| public long | |
| public int | |
| public boolean | isLarge()
Overrides org. Whether this object is too large to obtain as a byte array. |
| public ObjectStream | openStream()
Implements abstract org. Obtain an input stream to read this object's data. |
| Filter | back to summary |
|---|---|
| public Filter() | |
| delegate | back to summary |
|---|---|
| protected abstract ObjectLoader delegate() Get delegate ObjectLoader to handle all processing.
| |
| getCachedBytes | back to summary |
|---|---|
| public byte[] getCachedBytes() Implements abstract org. Doc from org. 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.
| |
| getSize | back to summary |
|---|---|
| public long getSize() Implements abstract org. Doc from org. Get size of object in bytes
| |
| getType | back to summary |
|---|---|
| public int getType() Implements abstract org. Doc from org. Get Git in pack object type
| |
| isLarge | back to summary |
|---|---|
| public boolean isLarge() Overrides org. Doc from org. Whether this object is too large to obtain as a byte array.
| |
| openStream | back to summary |
|---|---|
| public ObjectStream openStream() throws IOException Implements abstract org. Doc from org. Obtain an input stream to read this object's data.
| |
ObjectReader implementations can use this stream type when the object's content is small enough to be accessed as a single byte array.
| Access | Constructor and Description |
|---|---|
| public | SmallObject(int
type of the object. type, byte[] the object's data array. This array will be returned as-is
for the data)getCachedBytes() method.Construct a small object loader. |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | getCachedBytes()
Implements abstract org. Obtain a reference to the (possibly cached) bytes of this object. |
| public long | |
| public int | |
| public boolean | isLarge()
Overrides org. Whether this object is too large to obtain as a byte array. |
| public ObjectStream | openStream()
Implements abstract org. Obtain an input stream to read this object's data. |
| data | back to summary |
|---|---|
| private final byte[] data | |
| type | back to summary |
|---|---|
| private final int type | |
| SmallObject | back to summary |
|---|---|
| public SmallObject(int type, byte[] data) Construct a small object loader.
| |
| getCachedBytes | back to summary |
|---|---|
| public byte[] getCachedBytes() Implements abstract org. Doc from org. 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.
| |
| getSize | back to summary |
|---|---|
| public long getSize() Implements abstract org. Doc from org. Get size of object in bytes
| |
| getType | back to summary |
|---|---|
| public int getType() Implements abstract org. Doc from org. Get Git in pack object type
| |
| isLarge | back to summary |
|---|---|
| public boolean isLarge() Overrides org. Doc from org. Whether this object is too large to obtain as a byte array.
| |
| openStream | back to summary |
|---|---|
| public ObjectStream openStream() Implements abstract org. Doc from org. Obtain an input stream to read this object's data.
| |