Module com.github.akurilov.commons
Class ListOutput<T>
- java.lang.Object
-
- com.github.akurilov.commons.io.collection.ListOutput<T>
-
- All Implemented Interfaces:
Output<T>,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
CircularListOutput
public class ListOutput<T> extends java.lang.Object implements Output<T>
Writable collection of the items. Not thread safe.
-
-
Constructor Summary
Constructors Constructor Description ListOutput(java.util.List<T> items)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()does nothingListInput<T>getInput()Make aInputinstance from this.intput(java.util.List<T> items)intput(java.util.List<T> buffer, int from, int to)Bulk put of the items from the specified bufferbooleanput(T item)Write the data itemjava.lang.StringtoString()
-
-
-
Field Detail
-
items
protected final java.util.List<T> items
-
-
Constructor Detail
-
ListOutput
public ListOutput(java.util.List<T> items)
-
-
Method Detail
-
put
public boolean put(T item) throws java.io.IOException
Description copied from interface:OutputWrite the data item
-
put
public int put(java.util.List<T> buffer, int from, int to) throws java.io.IOException
Bulk put of the items from the specified buffer
-
put
public final int put(java.util.List<T> items) throws java.io.IOException
-
getInput
public ListInput<T> getInput() throws java.io.IOException
Description copied from interface:OutputMake aInputinstance from this.
-
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
-
-