Package ai.djl.inference.streaming
Class IteratorBytesSupplier
java.lang.Object
ai.djl.inference.streaming.IteratorBytesSupplier
- All Implemented Interfaces:
BytesSupplier
,Iterator<byte[]>
An
IteratorBytesSupplier
is a streaming BytesSupplier
suitable for synchronous
usage.-
Constructor Summary
ConstructorsConstructorDescriptionIteratorBytesSupplier
(Iterator<BytesSupplier> sources) Constructs anIteratorBytesSupplier
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ai.djl.ndarray.BytesSupplier
getAsObject, getAsString
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
IteratorBytesSupplier
Constructs anIteratorBytesSupplier
.- Parameters:
sources
- the source suppliers
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
public byte[] next() -
toByteBuffer
Returns theByteBuffer
presentation of the object.- Specified by:
toByteBuffer
in interfaceBytesSupplier
- Returns:
- the
ByteBuffer
presentation of the object
-
getAsBytes
public byte[] getAsBytes()Returns thebyte[]
presentation of the object.- Specified by:
getAsBytes
in interfaceBytesSupplier
- Returns:
- the
byte[]
presentation of the object
-