java.lang.Object
org.xbib.rpm.io.ChannelWrapper
org.xbib.rpm.io.WritableChannelWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,WritableByteChannel
Wrapper around a writable channel that allows
for observing written data.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.xbib.rpm.io.ChannelWrapper
ChannelWrapper.Consumer<T>, ChannelWrapper.Key<T> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying channel and completes any outstanding operations in the consumers.booleanisOpen()Flag indicating whether the underlying channel is open.intwrite(ByteBuffer buffer) Writes data to the wrapped channel, while passing an exact copy to the registered consumers.Methods inherited from class org.xbib.rpm.io.ChannelWrapper
empty, fill, fill, finish, startCount, startCount
-
Field Details
-
channel
-
-
Constructor Details
-
WritableChannelWrapper
-
-
Method Details
-
write
Writes data to the wrapped channel, while passing an exact copy to the registered consumers.- Specified by:
writein interfaceWritableByteChannel- Parameters:
buffer- the buffer to write to the wrapped channel- Returns:
- the number of bytes written
- Throws:
IOException- if an IO error occurs
-
close
Closes the underlying channel and completes any outstanding operations in the consumers.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Overrides:
closein classChannelWrapper- Throws:
IOException- if an IO error occurs
-
isOpen
public boolean isOpen()Flag indicating whether the underlying channel is open.
-