Interface MessageSink.Provider
- Enclosing interface:
MessageSink
public static interface MessageSink.Provider
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying I/O abstraction.voidflush()Flushes the underlying I/O abstraction.default longtransferFrom(ReadableByteChannel channel, long length, ByteBuffer buffer) Transfers up tolengthbytes from the given channel to the underlying I/O abstraction.voidwrite(ByteBuffer buffer) Writes the remaining bytes of the given byte buffer to the underlying I/O abstraction.voidwrite(ByteBuffer... buffers) Writes the remaining bytes of the given byte buffers to the underlying I/O abstraction.
-
Method Details
-
write
Writes the remaining bytes of the given byte buffer to the underlying I/O abstraction.- Parameters:
buffer- the byte buffer to read from- Throws:
IOException- if an I/O error occurs
-
write
Writes the remaining bytes of the given byte buffers to the underlying I/O abstraction.- Parameters:
buffers- the byte buffers to read from- Throws:
IOException- if an I/O error occurs
-
flush
Flushes the underlying I/O abstraction.- Throws:
IOException- if an I/O error occurs
-
close
Closes the underlying I/O abstraction.
This method is called at most once. No other method is called after this method.
- Throws:
IOException- if an I/O error occurs
-
transferFrom
default long transferFrom(ReadableByteChannel channel, long length, ByteBuffer buffer) throws IOException Transfers up to
lengthbytes from the given channel to the underlying I/O abstraction.Fewer than
lengthbytes may be transferred if the channel's end of input is reached.- Parameters:
channel- the channel to transfer bytes fromlength- the number of bytes to transferbuffer- A buffer whose remaining bytes must be transferred before transferringlengthbytes from the given channel. The buffer can also be used for transferring bytes from the channel.- Returns:
- the actual number of bytes transferred (between 0 and
length) - Throws:
IOException- if an I/O error occurs
-