Constructor and Description |
---|
AbstractSink() |
Modifier and Type | Method and Description |
---|---|
SeekableByteChannel |
channel()
Optional operation: Returns a seekable byte channel for
writing bytes.
|
OutputStream |
stream()
Returns an output stream for writing bytes.
|
public SeekableByteChannel channel() throws IOException
Because the intention of this interface is output, the returned channel
does not need to be able to position the file pointer or read data and
any attempt to do so may fail with a NonReadableChannelException
.
channel
in interface Sink
UnsupportedOperationException
- the implementation in the class
AbstractSink
always throws an exception of
this type.IOException
- on any I/O error.public OutputStream stream() throws IOException
The implementation in the class AbstractSink
calls
channel()
and wraps the result in a
ChannelOutputStream
adapter.
Note that this violates the contract for this method unless you
override either this method or channel()
with a valid
implementation.
stream
in interface Sink
IOException
- on any I/O error.Copyright © 2012–2017 Schlichtherle IT Services. All rights reserved.