net.netheos.pcsapi.bytesio
Class ProgressByteSink

java.lang.Object
  extended by net.netheos.pcsapi.bytesio.ProgressByteSink
All Implemented Interfaces:
ByteSink

public class ProgressByteSink
extends Object
implements ByteSink

Byte Sink used to monitor progress in stream operations. This class is meant to be used only internally. Use CDownloadRequest.setProgressListener() instead.


Constructor Summary
ProgressByteSink(ByteSink byteSink, ProgressListener listener)
           
 
Method Summary
 ByteSinkStream openStream()
          Returns a ByteSinkStream object for writing data, to be closed by caller.
 void setExpectedLength(long expectedLength)
          Defines the number of bytes that are expected to be written to the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressByteSink

public ProgressByteSink(ByteSink byteSink,
                        ProgressListener listener)
Method Detail

openStream

public ByteSinkStream openStream()
                          throws IOException
Description copied from interface: ByteSink
Returns a ByteSinkStream object for writing data, to be closed by caller. This method may be called several times (in case of retries)"

Specified by:
openStream in interface ByteSink
Returns:
ByteSinkStream
Throws:
IOException

setExpectedLength

public void setExpectedLength(long expectedLength)
Description copied from interface: ByteSink
Defines the number of bytes that are expected to be written to the stream. This value may be defined lately (after stream creation)

Note that this length may differ from the final data size, for example if bytes are appended to an already existing file.

Specified by:
setExpectedLength in interface ByteSink


Copyright © 2014. All Rights Reserved.