ServerJS/IO/A: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 69: Line 69:
== Memory based I/O ==
== Memory based I/O ==


The io module provides two classes for in-memory stream: ByteBuffer for an in-memory stream backed by a ByteArray, and StringBuffer for an in-memory text stream that works with strings. Memory based streams implement the same interface as the Stream and TextStream classes, respectively, and are readable, writable, and seekable.
The io module provides two classes for in-memory stream: ByteBuffer for an in-memory stream backed by a ByteArray, and StringBuffer for an in-memory text stream that works with strings.  
 
Memory based streams are readable, writable, and seekable and implement the interface defined for Stream and TextStream, respectively, including the '''read()''', '''readInto()''', and '''write()''' methods and the '''length''', and '''position''' properties.


=== ByteBuffer ===
=== ByteBuffer ===
Line 83: Line 85:


===== Instance Methods =====
===== Instance Methods =====
In addition to the methods and properties defined for the '''Stream''' class, ByteBuffers implement the following methods:


;append(b Binary)
;append(b Binary)
Line 105: Line 109:


===== Instance Methods =====
===== Instance Methods =====
In addition to the methods and properties defined for the '''TextStream''' class, ByteBuffers implement the following methods:


;append(s String)
;append(s String)
55

edits

Navigation menu