Class ByteArrayByteSupplier
java.lang.Object
cool.scx.io.supplier.ByteArrayByteSupplier
- All Implemented Interfaces:
ByteSupplier, AutoCloseable
ByteArrayByteSupplier
- Version:
- 0.0.1
- Author:
- scx567888
-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayByteSupplier(byte[]... byteArrays) ByteArrayByteSupplier(Collection<byte[]> byteArrays) -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ByteSupplier
close
-
Constructor Details
-
ByteArrayByteSupplier
-
ByteArrayByteSupplier
public ByteArrayByteSupplier(byte[]... byteArrays)
-
-
Method Details
-
get
Description copied from interface:ByteSupplier获取下一个数据块
- 必须是推进式的阻塞拉取
- 如果当前已经读取到有效数据 -> 返回 ByteChunk(len > 0)
- 如果暂时无法输出数据, 但 I/O 状态确实推进了 -> 返回 EMPTY_BYTE_CHUNK
- 如果 EOF 且不会再产生数据 -> 返回 null
- 不允许无状态的空循环: 供应者不得无意义地连续返回 EMPTY_BYTE_CHUNK
- 连续多次调用 get() 必须使底层数据源或解码状态单调推进
- Specified by:
getin interfaceByteSupplier- Returns:
- ByteChunk.
-