Package org.eclipse.jgit.util
Class LfsFactory.LfsInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.eclipse.jgit.util.LfsFactory.LfsInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- LfsFactory
public static final class LfsFactory.LfsInputStream extends InputStream
Encapsulate a potentially exchangedInputStream
along with the expected stream content length.
-
-
Constructor Summary
Constructors Constructor Description LfsInputStream(InputStream stream, long length)
Create a new wrapper around a certain streamLfsInputStream(TemporaryBuffer buffer)
Create a new wrapper around a temporary buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
getLength()
int
read()
int
read(byte[] b, int off, int len)
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
LfsInputStream
public LfsInputStream(InputStream stream, long length)
Create a new wrapper around a certain stream- Parameters:
stream
- the stream to wrap. the stream will be closed onclose()
.length
- the expected length of the stream
-
LfsInputStream
public LfsInputStream(TemporaryBuffer buffer) throws IOException
Create a new wrapper around a temporary buffer.- Parameters:
buffer
- the buffer to initialize stream and length from. The buffer will be destroyed onclose()
- Throws:
IOException
- in case of an error opening the stream to the buffer.
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
getLength
public long getLength()
- Returns:
- the length of the stream
-
-