java.lang.Object
org.miaixz.bus.core.io.sink.DeflaterSink
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,Sink
使用 Deflater 进行压缩的接收器,立即压缩并写入缓冲数据,调用 flush 会导致压缩率降低。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DeflaterSink
构造方法,使用指定的接收器和压缩器。- Parameters:
sink- 底层接收器deflater- 压缩器
-
-
Method Details
-
write
从源缓冲区读取指定字节数并压缩写入接收器。- Specified by:
writein interfaceSink- Parameters:
source- 数据源缓冲区byteCount- 要读取的字节数- Throws:
IOException- 如果写入失败
-
flush
刷新缓冲区,立即压缩并写入所有数据。- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceSink- Throws:
IOException- 如果刷新失败
-
close
关闭接收器,完成压缩并释放资源。- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSink- Throws:
IOException- 如果关闭失败
-
timeout
获取底层接收器的超时配置。 -
toString
返回对象的字符串表示。
-