{Stream-of t:Type} (class)
public abstract shared Stream-of
Package: CURL.IO.STREAM
Direct Known Subclasses: InputStream-of, OutputStream-of

Parameterized root of the stream hierarchy.

Notes

See InputStream-of and OutputStream-of for more information, including detailed method documentation.

Properties
non-blocking-supported?:Indicates if a particular instance or subclass supports non-blocking? flags to appropriate methods like InputStream-of.read or OutputStream-of.write.
accessor public Stream-of.non-blocking-supported?:bool
open?:Indicate if this Stream is currently open, should return false once Stream-of.close has been called.
accessor public abstract Stream-of.open?:bool
origin-url:Returns the Url that this stream was opened from, or null, if no such Url exists.
accessor public abstract Stream-of.origin-url:#Url
Methods
close:Close Stream, should make stream un-usable and make sure that Stream-of.open? return false once this has been called.
public abstract {Stream-of.close}:void
verify-open:Throw an IOException if this Stream is not open, as indicated by Stream-of.open?.
public final inline {Stream-of.verify-open}:void
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Property Details
non-blocking-supported? (accessor)
accessor public Stream-of.non-blocking-supported?:bool

Indicates if a particular instance or subclass supports non-blocking? flags to appropriate methods like InputStream-of.read or OutputStream-of.write.

Notes

This also causes default implementations of those methods in InputStream-of or OutputStream-of to assume that the methods InputStream-of.read-one or OutputStream-of.write-one, that they call, will never block. If those methods can block in a a particular subclass then Stream-of.non-blocking-supported? must stay false or the default implementation of InputStream-of.read or OutputStream-of.write must be overridden to provide non-blocking support.


open? (accessor)
accessor public abstract Stream-of.open?:bool

Indicate if this Stream is currently open, should return false once Stream-of.close has been called.

Notes

Used by default implementations in InputStream-of and OutputStream-of to error out from many operations if stream is not open.

Overriding

Subclasses must provide this.


origin-url (accessor)
accessor public abstract Stream-of.origin-url:#Url

Returns the Url that this stream was opened from, or null, if no such Url exists.

Example

{read-open {url "file://c:/foo.txt"}}.origin-url would return the Url file://c:/foo.txt (assuming such a file exists).

On the other hand, {{TextInputStream-from String} "foo"}.origin-url would return null.


Method Details
close (method)
public abstract {Stream-of.close}:void

Close Stream, should make stream un-usable and make sure that Stream-of.open? return false once this has been called.



verify-open (method)
public final inline {Stream-of.verify-open}:void

Throw an IOException if this Stream is not open, as indicated by Stream-of.open?.

Notes

Subclasses should use this in their implementations of InputStream-of.read-one, OutputStream-of.write-one and similar methods.
Introduced in: version 6.0