| 限定符和类型 | 方法和说明 |
|---|---|
OutputStream |
getOutputStream()
Return an
OutputStream for the underlying resource,
allowing to (over-)write its content. |
Object |
getRealResource() |
boolean |
isWritable()
Indicate whether the contents of this resource can be written
via
getOutputStream(). |
WritableByteChannel |
writableChannel()
Return a
WritableByteChannel. |
contentLength, exists, getInputStream, isReadable, readableChannelboolean isWritable()
getOutputStream().
Will be true for typical resource descriptors;
note that actual content writing may still fail when attempted.
However, a value of false is a definitive indication
that the resource content cannot be modified.
OutputStream getOutputStream() throws IOException
OutputStream for the underlying resource,
allowing to (over-)write its content.IOException - if the stream could not be openedResource.getInputStream()WritableByteChannel writableChannel() throws IOException
WritableByteChannel.
It is expected that each call creates a fresh channel.
The default implementation returns Channels.newChannel(OutputStream)
with the result of getOutputStream().
null)FileNotFoundException - if the underlying resource doesn't existIOException - if the content channel could not be openedgetOutputStream()Object getRealResource()
getRealResource 在接口中 ResourceCopyright © 2022. All rights reserved.