Package org.exbin.auxiliary.paged_data
Class ByteArrayDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.exbin.auxiliary.paged_data.ByteArrayDataInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,FinishableStream,SeekableStream
@ParametersAreNonnullByDefault public class ByteArrayDataInputStream extends java.io.InputStream implements SeekableStream, FinishableStream
Input stream for byte array data.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayDataInputStream(ByteArrayData data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()longfinish()Reads remaining data and returns size of all data processed by this stream.longgetProcessedSize()Returns size of data processed so far.longgetStreamSize()Returns length of the stream.intread()intread(byte[] output, int off, int len)voidseek(long position)Moves position in the stream to given position from the start of the stream.
-
-
-
Constructor Detail
-
ByteArrayDataInputStream
public ByteArrayDataInputStream(ByteArrayData data)
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] output, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
seek
public void seek(long position) throws java.io.IOExceptionDescription copied from interface:SeekableStreamMoves position in the stream to given position from the start of the stream.- Specified by:
seekin interfaceSeekableStream- Parameters:
position- target position- Throws:
java.io.IOException- if input/output error
-
finish
public long finish() throws java.io.IOExceptionDescription copied from interface:FinishableStreamReads remaining data and returns size of all data processed by this stream.- Specified by:
finishin interfaceFinishableStream- Returns:
- size of data in bytes
- Throws:
java.io.IOException- if input/output error occurs
-
getProcessedSize
public long getProcessedSize()
Description copied from interface:FinishableStreamReturns size of data processed so far.- Specified by:
getProcessedSizein interfaceFinishableStream- Returns:
- size of data in bytes
-
getStreamSize
public long getStreamSize()
Description copied from interface:SeekableStreamReturns length of the stream.- Specified by:
getStreamSizein interfaceSeekableStream- Returns:
- length of the stream in bytes, -1 if unable to determine
-
-