Class LazyInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.jackrabbit.oak.commons.io.LazyInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class LazyInputStream extends FilterInputStream
* This input stream delays accessing theInputStream
until the first byte is read
-
-
Constructor Summary
Constructors Constructor Description LazyInputStream(ByteSource byteSource)
Deprecated.UseLazyInputStream(Supplier)
insteadLazyInputStream(Supplier<InputStream> inputStreamSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
LazyInputStream
public LazyInputStream(Supplier<InputStream> inputStreamSupplier)
-
LazyInputStream
@Deprecated public LazyInputStream(ByteSource byteSource)
Deprecated.UseLazyInputStream(Supplier)
instead
-
-
Method Detail
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classFilterInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classFilterInputStream
-
-