org.eclipse.jgit.lib
Class ObjectStream.SmallStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.eclipse.jgit.lib.ObjectStream
          extended by org.eclipse.jgit.lib.ObjectStream.SmallStream
All Implemented Interfaces:
Closeable
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
ObjectStream.SmallStream(int type, byte[] data)
          Create the stream from an existing byte array and type.
ObjectStream.SmallStream(ObjectLoader loader)
          Create the stream from an existing loader's cached bytes.
 
Method Summary
 int available()
           
 long getSize()
           
 int getType()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.InputStream
close, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectStream.SmallStream

public ObjectStream.SmallStream(ObjectLoader loader)
Create the stream from an existing loader's cached bytes.

Parameters:
loader - the loader.

ObjectStream.SmallStream

public ObjectStream.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()
Specified by:
getType in class ObjectStream
Returns:
Git object type, see Constants.

getSize

public long getSize()
Specified by:
getSize in class ObjectStream
Returns:
total size of object in bytes

available

public int available()
Overrides:
available in class InputStream

skip

public long skip(long n)
Overrides:
skip in class InputStream

read

public int read()
Specified by:
read in class InputStream

read

public int read(byte[] b,
                int off,
                int len)
Overrides:
read in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

reset

public void reset()
Overrides:
reset in class InputStream


Copyright © 2012. All Rights Reserved.