public static final class LfsFactory.LfsInputStream
extends java.io.InputStream
InputStream
along with the
expected stream content length.Modifier and Type | Field and Description |
---|---|
private long |
length
The expected stream content length.
|
private java.io.InputStream |
stream
The actual stream.
|
Constructor and Description |
---|
LfsInputStream(java.io.InputStream stream,
long length)
Create a new wrapper around a certain stream
|
LfsInputStream(TemporaryBuffer buffer)
Create a new wrapper around a temporary buffer.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getLength() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
private java.io.InputStream stream
private long length
public LfsInputStream(java.io.InputStream stream, long length)
stream
- the stream to wrap. the stream will be closed on
close()
.length
- the expected length of the streampublic LfsInputStream(TemporaryBuffer buffer) throws java.io.IOException
buffer
- the buffer to initialize stream and length from. The
buffer will be destroyed on close()
java.io.IOException
- in case of an error opening the stream to the buffer.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long getLength()