net.netheos.pcsapi.bytesio
Class ProgressByteSinkStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by net.netheos.pcsapi.bytesio.ByteSinkStream
              extended by net.netheos.pcsapi.bytesio.ProgressByteSinkStream
All Implemented Interfaces:
Closeable, Flushable

public class ProgressByteSinkStream
extends ByteSinkStream

Byte sink stream that reports progress in stream operations


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ProgressByteSinkStream(ByteSinkStream byteSinkStream, ProgressListener listener)
           
 
Method Summary
 void abort()
          Aborts operations with this stream (writes will stop before expected end).
 long getCurrentBytes()
          Count the read bytes
 boolean isAborted()
          Indicates if the sink has been aborted
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressByteSinkStream

public ProgressByteSinkStream(ByteSinkStream byteSinkStream,
                              ProgressListener listener)
Method Detail

getCurrentBytes

public long getCurrentBytes()
Count the read bytes

Returns:
The bytes count

write

public void write(int b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

abort

public void abort()
Description copied from class: ByteSinkStream
Aborts operations with this stream (writes will stop before expected end). Implementations may use this method to delete temporary file or indicate some warning.

abort() must be called before close()

Specified by:
abort in class ByteSinkStream

isAborted

public boolean isAborted()
Description copied from class: ByteSinkStream
Indicates if the sink has been aborted

Specified by:
isAborted in class ByteSinkStream
Returns:
true if aborted, false otherwise


Copyright © 2014. All Rights Reserved.