java.lang.Object
org.miaixz.bus.core.io.sink.AssignSink
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,Sink
- Direct Known Subclasses:
FaultHideSink
将操作转发给另一个
Sink 的抽象接收器。- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AssignSink
构造方法,初始化代理接收器。- Parameters:
delegate- 代理的接收器,不能为 null- Throws:
IllegalArgumentException- 如果 delegate 为 null
-
-
Method Details
-
delegate
获取代理的接收器。- Returns:
- 代理的接收器
-
write
从源缓冲区读取指定字节数并写入代理接收器。- Specified by:
writein interfaceSink- Parameters:
source- 数据源缓冲区byteCount- 要读取的字节数- Throws:
IOException- 如果写入失败
-
flush
将缓冲数据刷新到代理接收器。- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceSink- Throws:
IOException- 如果刷新失败
-
timeout
获取代理接收器的超时配置。 -
close
关闭代理接收器并释放资源。- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSink- Throws:
IOException- 如果关闭失败
-
toString
返回对象的字符串表示。
-