Class InputStreamByteSupplier

java.lang.Object
cool.scx.bytes.supplier.InputStreamByteSupplier
All Implemented Interfaces:
ByteSupplier

public class InputStreamByteSupplier extends Object implements ByteSupplier
InputStreamDataSupplier 1, 当大部分时候读取的数据长度等于 bufferLength 的时候, 性能会高一点 因为只会进行数组创建这一步 2, 当大部分时候读取的数据长度小于 bufferLength 的时候, 性能会差一点 因为每次都会创建一个 bufferLength 大小的数组 如果启用压缩则会产生第二次复制 增加时间 如果未启用压缩则会造成内存上的一些浪费 这时建议使用 BufferedInputStreamByteSupplier
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • InputStreamByteSupplier

      public InputStreamByteSupplier(InputStream inputStream)
    • InputStreamByteSupplier

      public InputStreamByteSupplier(InputStream inputStream, boolean compress)
    • InputStreamByteSupplier

      public InputStreamByteSupplier(InputStream inputStream, int bufferLength)
    • InputStreamByteSupplier

      public InputStreamByteSupplier(InputStream inputStream, int bufferLength, boolean compress)
  • Method Details