net.netheos.pcsapi.bytesio
Class MemoryByteSinkStream

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.MemoryByteSinkStream
All Implemented Interfaces:
Closeable, Flushable

public class MemoryByteSinkStream
extends ByteSinkStream

Implements the in-memory version of a byte sink stream


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
MemoryByteSinkStream(MemoryByteSink memoryByteSink, ByteArrayOutputStream baos)
           
 
Method Summary
 void abort()
          Aborts operations with this stream (writes will stop before expected end).
 void close()
           
 boolean isAborted()
          Indicates if the sink has been aborted
 
Methods inherited from class java.io.FilterOutputStream
flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryByteSinkStream

public MemoryByteSinkStream(MemoryByteSink memoryByteSink,
                            ByteArrayOutputStream baos)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close 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.