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
Encapsulate a potentially exchanged
InputStream along with the
expected stream content length.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longThe expected stream content length.private InputStreamThe actual stream. -
Constructor Summary
ConstructorsConstructorDescriptionLfsInputStream(InputStream stream, long length) Create a new wrapper around a certain streamLfsInputStream(TemporaryBuffer buffer) Create a new wrapper around a temporary buffer. -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
stream
The actual stream. -
length
private long lengthThe expected stream content length.
-
-
Constructor Details
-
LfsInputStream
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
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 Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
getLength
public long getLength()- Returns:
- the length of the stream
-