Package com.github.jinahya.bit.io
Class ListReader<E>
java.lang.Object
com.github.jinahya.bit.io.ListReader<E>
- Type Parameters:
E
- element type parameter
- All Implemented Interfaces:
BitReader<List<E>>
,ReadsCount<ListReader<E>>
A reader for reading lists of specific element type.
- Author:
- Jin Kwon <onacit_at_gmail.com>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionListReader
(BitReader<? extends E> elementReader) Creates a new instance for reading lists of specified element type using specified element reader. -
Method Summary
Modifier and TypeMethodDescriptionReads a value from specified input.void
setCountReader
(ToIntFunction<? super BitInput> countReader) Configures to use specified function for reading thecount
of elements.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.jinahya.bit.io.ReadsCount
countReader
-
Constructor Details
-
ListReader
Creates a new instance for reading lists of specified element type using specified element reader.- Parameters:
elementReader
- the reader for reading elements.
-
-
Method Details
-
read
Description copied from interface:BitReader
Reads a value from specified input.- Specified by:
read
in interfaceBitReader<E>
- Parameters:
input
- the input from which a value is read.- Returns:
- a value read.
- Throws:
IOException
- if an I/O error occurs.- See Also:
-
setCountReader
Description copied from interface:ReadsCount
Configures to use specified function for reading thecount
of elements.- Specified by:
setCountReader
in interfaceReadsCount<E>
- Parameters:
countReader
- the function applies with aninput
and reads thecount
.
-