spring-framework / org.springframework.core.io / WritableResource / writableChannel

writableChannel

open fun writableChannel(): WritableByteChannel

Return a WritableByteChannel.

It is expected that each call creates a fresh channel.

The default implementation returns Channels#newChannel(OutputStream) with the result of #getOutputStream().

Exceptions

java.io.FileNotFoundException - if the underlying resource doesn't exist

IOException - if the content channel could not be opened

Return
the byte channel for the underlying resource (must not be null)

Since
5.0

See Also
#getOutputStream()