BUFFER
- is the generic type of the buffers provided by getPool()
.protected abstract class StreamUtilImpl.BaseTransferrer<BUFFER> extends StreamUtilImpl.AbstractAsyncTransferrer
AsyncTransferrer
interface, that implements
Runnable
defining the main flow.Modifier and Type | Field and Description |
---|---|
private TransferCallback |
callback
The callback or
null . |
private boolean |
keepDestinationOpen
true if destination should be closed. |
Constructor and Description |
---|
BaseTransferrer(TransferCallback callback,
boolean keepDestinationOpen)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
Long |
call() |
protected abstract Closeable |
getDestination()
This method gets the destination to transfer to.
|
protected abstract Pool<BUFFER> |
getPool()
This method gets the
Pool to retrieve buffers. |
protected abstract Closeable |
getSource()
This method gets the source to transfer.
|
protected long |
transfer()
This method performs the actual transfer.
|
protected abstract long |
transfer(BUFFER buffer)
This method performs the actual transfer.
|
isCompleted, isStopped, setCompleted, stop
private final TransferCallback callback
null
.private final boolean keepDestinationOpen
true
if destination
should be closed.public BaseTransferrer(TransferCallback callback, boolean keepDestinationOpen)
callback
- is the callback or null
.keepDestinationOpen
- true
if the destination
should be closed,
false
otherwise.protected abstract Closeable getSource()
InputStream
or Reader
).protected abstract Closeable getDestination()
OutputStream
or Writer
).protected abstract Pool<BUFFER> getPool()
Pool
to retrieve buffers.Pool
.protected abstract long transfer(BUFFER buffer) throws IOException
buffer
- is the buffer used for the transfer.IOException
- if the transfer failed.protected long transfer() throws RuntimeIoException
RuntimeIoException
- if the transfer failed.Copyright © 2001–2016 mmm-Team. All rights reserved.