Package ai.djl.inference.streaming
Class IteratorBytesSupplier
- java.lang.Object
-
- ai.djl.inference.streaming.IteratorBytesSupplier
-
- All Implemented Interfaces:
BytesSupplier,java.util.Iterator<byte[]>
public class IteratorBytesSupplier extends java.lang.Object implements BytesSupplier, java.util.Iterator<byte[]>
AnIteratorBytesSupplieris a streamingBytesSuppliersuitable for synchronous usage.
-
-
Constructor Summary
Constructors Constructor Description IteratorBytesSupplier(java.util.Iterator<BytesSupplier> sources)Constructs anIteratorBytesSupplier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getAsBytes()Returns thebyte[]presentation of the object.booleanhasNext()byte[]next()java.nio.ByteBuffertoByteBuffer()Returns theByteBufferpresentation of the object.-
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
-
-
-
-
Constructor Detail
-
IteratorBytesSupplier
public IteratorBytesSupplier(java.util.Iterator<BytesSupplier> sources)
Constructs anIteratorBytesSupplier.- Parameters:
sources- the source suppliers
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<byte[]>
-
next
public byte[] next()
- Specified by:
nextin interfacejava.util.Iterator<byte[]>
-
toByteBuffer
public java.nio.ByteBuffer toByteBuffer()
Returns theByteBufferpresentation of the object.- Specified by:
toByteBufferin interfaceBytesSupplier- Returns:
- the
ByteBufferpresentation of the object
-
getAsBytes
public byte[] getAsBytes()
Returns thebyte[]presentation of the object.- Specified by:
getAsBytesin interfaceBytesSupplier- Returns:
- the
byte[]presentation of the object
-
-