Class InputStreamDataSupplier
java.lang.Object
cool.scx.io.InputStreamDataSupplier
- All Implemented Interfaces:
DataSupplier
InputStreamDataSupplier
1, 当大部分时候读取的数据长度等于 bufferLength 的时候, 性能会高一点 因为只会进行数组创建这一步
2, 当大部分时候读取的数据长度小于 bufferLength 的时候, 性能会差一点 因为每次都会创建一个 bufferLength 大小的数组
如果启用压缩则会产生第二次复制 增加时间
如果未启用压缩则会造成内存上的一些浪费
这时建议使用
BufferedInputStreamDataSupplier- Version:
- 0.0.1
- Author:
- scx567888
-
Constructor Summary
ConstructorsConstructorDescriptionInputStreamDataSupplier(InputStream inputStream) InputStreamDataSupplier(InputStream inputStream, boolean compress) InputStreamDataSupplier(InputStream inputStream, int bufferLength) InputStreamDataSupplier(InputStream inputStream, int bufferLength, boolean compress) -
Method Summary
-
Constructor Details
-
InputStreamDataSupplier
-
InputStreamDataSupplier
-
InputStreamDataSupplier
-
InputStreamDataSupplier
-
-
Method Details
-
get
Description copied from interface:DataSupplier获取数据 如果没有数据请返回 null- Specified by:
getin interfaceDataSupplier- Returns:
- 数据节点 或 null
-