serializer.buffered stream - Palamecia/mint GitHub Wiki
Module serializer.buffered-stream
Description
load serializer.buffered-stream
This module provides the Serializer.BufferedStream class which is a convenient wrapper to add buffering to a stream object.
Packages
Classes
Serializer.BufferedStream
This class creates a convenient interface for reading and writing data on a stream object. Data from the underlying object are stored in a buffer to get retrieved later.
Public members
| Modifiers | Member | Description |
|---|---|---|
const |
<< | Writes data to the stream, and returns a reference to the stream. |
const |
>> | Reads the remaining data from the stream and stores it in data, then returns ... |
const |
isEmpty | Returns true if the stream has no more data to read; otherwise returns false. |
const |
new | Creates a new stream for reading and writing data using stream. |
const |
read | Reads all remaining data from the stream and returns it as an instance of Ser... |
const |
readSome | Reads at most count bytes of data from the stream and returns it as an instan... |
const |
write | Writes the content of data to the stream. The write method of the underlying ... |
Private members
| Modifiers | Member | Description |
|---|---|---|
final |
buffer | Internal read buffer. |
final |
pos | Internal read index. |
final const |
refill | Refill the internal read buffer with some data from the stream. Returns true ... |
final |
stream | Internal underlying stream. |
Descriptions
Serializer.BufferedStream.<<
def (self, data)
Writes data to the stream, and returns a reference to the stream.
Serializer.BufferedStream.>>
def (self, data)
Reads the remaining data from the stream and stores it in data, then returns a reference to the stream.
Serializer.BufferedStream.buffer
null
Internal read buffer.
Serializer.BufferedStream.isEmpty
def (const self)
Returns true if the stream has no more data to read; otherwise returns false.
Serializer.BufferedStream.new
def (self, stream)
Creates a new stream for reading and writing data using stream.
Serializer.BufferedStream.pos
0
Internal read index.
Serializer.BufferedStream.read
def (self)
Reads all remaining data from the stream and returns it as an instance of Serializer.DataStream or returns
none if no more byte is available on the stream.
Serializer.BufferedStream.readSome
def (self, count)
Reads at most count bytes of data from the stream and returns it as an instance of Serializer.DataStream or
returns none if no more byte is available on the stream.
Serializer.BufferedStream.refill
def (self)
Refill the internal read buffer with some data from the stream. Returns true if the buffer has been refilled;
otherwise returns false.
Serializer.BufferedStream.stream
null
Internal underlying stream.
Serializer.BufferedStream.write
def (self, data)
Writes the content of data to the stream. The write method of the underlying object is used to write the
data.