Package org.aksw.iguana.commons.io
Class ByteArrayListInputStream
java.lang.Object
java.io.InputStream
org.aksw.iguana.commons.io.ByteArrayListInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An InputStream that reads from a list of byte arrays.
-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayListInputStream(List<byte[]> data) Creates a new ByteArrayListInputStream that reads from the given list of byte arrays. -
Method Summary
Modifier and TypeMethodDescriptionintlongReturns the number of bytes available to read from the stream.voidclose()Returns the current buffer that is being read from.intread()intread(byte[] b, int off, int len) byte[]intreadNBytes(byte[] b, int off, int len) byte[]readNBytes(int len) longskip(long n) voidskipNBytes(long n) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, reset, transferTo
-
Constructor Details
-
ByteArrayListInputStream
Creates a new ByteArrayListInputStream that reads from the given list of byte arrays. The list is not copied, so it should not be modified while the stream is in use.- Parameters:
data- the list of byte arrays to read from
-
-
Method Details
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
readAllBytes
- Overrides:
readAllBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
skipNBytes
- Overrides:
skipNBytesin classInputStream- Throws:
IOException
-
available
public int available()- Overrides:
availablein classInputStream
-
availableLong
public long availableLong()Returns the number of bytes available to read from the stream.- Returns:
- the number of bytes available
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
getCurrentBuffer
Returns the current buffer that is being read from.- Returns:
- the current buffer
-