-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable,org.readium.r2.shared.util.zip.jvm.Channel
public interface WritableByteChannel implements Channel
A
{@code WritableByteChannel}is a type of Channel that can write bytes.Write operations are synchronous on a
{@code WritableByteChannel}, that is, if a write is already in progress on the channel then subsequent writes will block until the first write completes. It is undefined whether non-write operations will block.
-
-
Method Summary
Modifier and Type Method Description abstract intwrite(ByteBuffer buffer)Writes bytes from the given buffer to the channel. -
-
Method Detail
-
write
abstract int write(ByteBuffer buffer)
Writes bytes from the given buffer to the channel.
The maximum number of bytes that will be written is the
remaining()number of bytes in the buffer when the methodinvoked. The bytes will be written from the buffer starting at thebuffer'sposition.The call may block if other threads are also attempting to write on thesame channel.
Upon completion, the buffer's
position()is updated to theend of the bytes that were written. The buffer'slimit()is unmodified.- Parameters:
buffer- the byte buffer containing the bytes to be written.
-
-
-
-