ewe.io
Interface Streamable

All Known Implementing Classes:
BasicStreamObject, FileBase, InputStream, OutputStream

public interface Streamable


Method Summary
 String getName()
          Get the name associated with this Streamable object.
 Handle toStream(boolean randomStream, String mode)
          Requests the possibly asynchronous creation of a Stream object for reading or writing.
 

Method Detail

toStream

public Handle toStream(boolean randomStream,
                       String mode)
                throws IllegalArgumentException
Requests the possibly asynchronous creation of a Stream object for reading or writing.

Parameters:
randomStream - if this is true then a request is being made for a RandomAccessStream, otherwise either a readable or writable Stream will be returned.
mode - For RandomAccessStreams this can be "r" or "rw". For writable Streams this should be "w" or "a" (for append) and for readable Streams it should be "r".
Returns:
A Handle used to form monitoring the creation process and for retrieving the final value.

The calling code should wait on the Handle.Success flag to be set. If this happens the returnValue of the Handle will be set to the acquired Stream. If the Handle fails then the errorObject of the Handle will be set to an IOException.

Throws:
IllegalArgumentException - if the mode is incorrect.

getName

public String getName()
Get the name associated with this Streamable object.