Module com.github.akurilov.commons
Class ListInput<T>
- java.lang.Object
-
- com.github.akurilov.commons.io.collection.ListInput<T>
-
- All Implemented Interfaces:
Input<T>,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
BufferingInputBase,CircularListInput
public class ListInput<T> extends java.lang.Object implements Input<T>
Readable collection of the items. Not thread safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Does nothingTget()Get next itemintget(java.util.List<T> buffer, int maxCount)Bulk get into the specified buffervoidreset()Reset this input making this readable from the beginninglongskip(long itemsCount)Skip some items.java.lang.StringtoString()
-
-
-
Field Detail
-
items
protected final java.util.List<T> items
-
size
protected int size
-
i
protected int i
-
-
Constructor Detail
-
ListInput
public ListInput(java.util.List<T> items)
-
-
Method Detail
-
get
public T get() throws java.io.EOFException, java.io.IOException
Description copied from interface:InputGet next item
-
get
public int get(java.util.List<T> buffer, int maxCount) throws java.io.EOFException, java.io.IOException
Bulk get into the specified buffer
-
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.IOExceptionDoes nothing- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException- doesn't throw
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-