ServerJS/IO/A: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 13: Line 13:
=== Stream ===
=== Stream ===


The Stream class implements a stream for reading and writing raw bytes.
The Stream class implements a I/O stream for reading and writing raw bytes.


;Constructor
===== Constructor =====
:Whether the Stream class provides a public constructor, and what the arguments of the constructor are, is not part of this specification. The process of creating actual Stream objects is implementation specific.


:Various built-in modules such as the [[ServerJS/Filesystem_API|file module]] will know how to build native Stream objects in a platform specific way. Application classes should be able to extend the Stream class through JavaScript prototype chaining. However, duck typing should also work for Stream objects, meaning that any object implementing the Stream interface ''should'' work for code expecting an io.Stream object.
Whether the Stream class provides a public constructor, and what the arguments of the constructor are, is not part of this specification. The process of creating actual Stream objects is implementation specific.
 
Various built-in modules such as the [[ServerJS/Filesystem_API|file module]] will know how to build native Stream objects in a platform specific way. Application classes should be able to extend the Stream class through JavaScript prototype chaining. However, duck typing should also work for Stream objects, meaning that any object implementing the Stream interface ''should'' work for code expecting an io.Stream object.


===== Instance Properties =====
===== Instance Properties =====
Line 74: Line 75:


=== ByteBuffer ===
=== ByteBuffer ===
The ByteBuffer class implements a raw byte based I/O stream as a memory buffer.
===== Constructor =====


;[new] ByteBuffer() ByteBuffer
;[new] ByteBuffer() ByteBuffer
Line 98: Line 103:


=== StringBuffer ===
=== StringBuffer ===
The StringBuffer class implements a string byte based I/O stream as a memory buffer.
===== Constructor =====


;[new] StringBuffer() StringBuffer
;[new] StringBuffer() StringBuffer
55

edits

Navigation menu