- java.lang.Object
-
- com.github.akurilov.commons.io.BinInput<T>
-
- All Implemented Interfaces:
Input<T>,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
BinFileInput
public class BinInput<T> extends java.lang.Object implements Input<T>
The item input implementation deserializing the data items from the specified stream
-
-
Constructor Summary
Constructors Constructor Description BinInput(java.io.ObjectInputStream itemsSrc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Tget()Get next itemintget(java.util.List<T> dstBuff, int dstCountLimit)Bulk items get.voidreset()Reset this input making this readable from the beginningvoidsetItemsSrc(java.io.ObjectInputStream itemsSrc)longskip(long itemsCount)Skip some items.java.lang.StringtoString()
-
-
-
Field Detail
-
itemsSrc
protected java.io.ObjectInputStream itemsSrc
-
srcBuff
protected T[] srcBuff
-
srcBuffPos
protected int srcBuffPos
-
-
Method Detail
-
setItemsSrc
public void setItemsSrc(java.io.ObjectInputStream itemsSrc)
-
get
public final T get() throws java.io.IOException
Description copied from interface:InputGet next item
-
get
public final int get(java.util.List<T> dstBuff, int dstCountLimit) throws java.io.IOException
Description copied from interface:InputBulk items get.- Specified by:
getin interfaceInput<T>- Parameters:
dstBuff- buffer for the itemsdstCountLimit- max count of the items to put into the buffer- Returns:
- count of the items have been get and put into the buffer actually
- Throws:
java.io.EOFException- if no item available morejava.io.IOException- if failed to get some-why
-
reset
public void reset() throws java.io.IOExceptionDescription copied from interface:InputReset this input making this readable from the beginning
-
skip
public long skip(long itemsCount) throws java.io.IOExceptionDescription copied from interface:InputSkip some items.
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-