- java.lang.Object
-
- java.io.InputStream
-
- org.eclipse.jgit.lib.ObjectStream
-
- org.eclipse.jgit.lib.ObjectStream.SmallStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- ObjectStream
public static class ObjectStream.SmallStream extends ObjectStream
Simple stream around the cached byte array created by a loader.ObjectLoader implementations can use this stream type when the object's content is small enough to be accessed as a single byte array, but the application has still requested it in stream format.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.ObjectStream
ObjectStream.Filter, ObjectStream.SmallStream
-
-
Constructor Summary
Constructors Constructor Description SmallStream(int type, byte[] data)Create the stream from an existing byte array and type.SmallStream(ObjectLoader loader)Create the stream from an existing loader's cached bytes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()longgetSize()Get total size of object in bytesintgetType()Get Git object type, seeConstants.voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b, int off, int len)voidreset()longskip(long n)-
Methods inherited from class java.io.InputStream
close, nullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
SmallStream
public SmallStream(ObjectLoader loader)
Create the stream from an existing loader's cached bytes.- Parameters:
loader- the loader.
-
SmallStream
public SmallStream(int type, byte[] data)Create the stream from an existing byte array and type.- Parameters:
type- the type constant for the object.data- the fully inflated content of the object.
-
-
Method Detail
-
getType
public int getType()
Description copied from class:ObjectStreamGet Git object type, seeConstants.- Specified by:
getTypein classObjectStream- Returns:
- Git object type, see
Constants.
-
getSize
public long getSize()
Description copied from class:ObjectStreamGet total size of object in bytes- Specified by:
getSizein classObjectStream- Returns:
- total size of object in bytes
-
available
public int available()
- Overrides:
availablein classInputStream
-
skip
public long skip(long n)
- Overrides:
skipin classInputStream
-
read
public int read()
- Specified by:
readin classInputStream
-
read
public int read(byte[] b, int off, int len)- Overrides:
readin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
reset
public void reset()
- Overrides:
resetin classInputStream
-
-