Interface ResourceContents
- All Known Implementing Classes:
UnixFSTemporaryResourceContents
public interface ResourceContents
-
Method Summary
Modifier and TypeMethodDescriptionread()
Reads from the channel.default Optional
<WritableByteChannel> Writes to the channel.default WritableByteChannel
Writes to the channel, throwing an exception if not supported.
-
Method Details
-
read
Reads from the channel.- Returns:
- the
ReadableByteChannel
to read the contents - Throws:
IOException
- if there was an error reading the underlying contents
-
write
Writes to the channel, throwing an exception if not supported.- Returns:
- the
ReadableByteChannel
to read the contents - Throws:
IOException
- if there was an error writing the underlying contents
-
tryWrite
Writes to the channel. Returning an empty Optional if not supported.- Returns:
- the
ReadableByteChannel
to read the contents - Throws:
IOException
- if there was an error writing the underlying contents
-