serializer.datastream - Palamecia/mint GitHub Wiki
load serializer.datastream
This module provides the Serializer.DataStream class which allow to manipulate raw data.
This class provides an interface for reading and writing raw data. It is mean to be used by any code that perform low level operations.
Modifiers | Member | Description |
---|---|---|
const |
<< | Writes the content of data to the stream, then returns a reference to the s... |
const |
>> | Reads some data from the stream and stores it in data , then returns a refer... |
const |
containsBoolean | Returns true if the stream contains at least one boolean; otherwise returns... |
const |
containsInt16 | Returns true if the stream contains at least count int16; otherwise retur... |
const |
containsInt32 | Returns true if the stream contains at least count int32; otherwise retur... |
const |
containsInt64 | Returns true if the stream contains at least count int64; otherwise retur... |
const |
containsInt8 | Returns true if the stream contains at least count int8; otherwise return... |
const |
containsNumber | Returns true if the stream contains at least count numbers; otherwise ret... |
const |
containsString | Returns true if the stream contains at least one string; otherwise returns ... |
const |
containsUInt16 | Returns true if the stream contains at least count uint16; otherwise retu... |
const |
containsUInt32 | Returns true if the stream contains at least count uint32; otherwise retu... |
const |
containsUInt64 | Returns true if the stream contains at least count uint64; otherwise retu... |
const |
containsUInt8 | Returns true if the stream contains at least count uint8; otherwise retur... |
@ const
|
fromBase64 | Creates a new stream containing the data of data decoded from Base64. Retur... |
@ const
|
fromBase64Url | Creates a new stream containing the data of data decoded from Base64Url. Re... |
@ const
|
fromUtf8Bytes | Creates a new stream containing the count first bytes from the bytes stri... |
const |
getBoolean | Returns the next instance of boolean in the stream. If the stream does not co... |
const |
getInt16 | Returns the next instance of int16 in the stream. If the stream does not cont... |
const |
getInt32 | Returns the next instance of int32 in the stream. If the stream does not cont... |
const |
getInt64 | Returns the next instance of int64 in the stream. If the stream does not cont... |
const |
getInt8 | Returns the next instance of int8 in the stream. If the stream does not conta... |
const |
getNumber | Returns the next instance of number in the stream. If the stream does not con... |
const |
getString | Returns the next instance of string in the stream. If the stream does not con... |
const |
getUInt16 | Returns the next instance of uint16 in the stream. If the stream does not con... |
const |
getUInt32 | Returns the next instance of uint32 in the stream. If the stream does not con... |
const |
getUInt64 | Returns the next instance of uint64 in the stream. If the stream does not con... |
const |
getUInt8 | Returns the next instance of uint8 in the stream. If the stream does not cont... |
const |
isEmpty | Returns true if the stream has no more data to read; otherwise returns fa ... |
const |
new | Creates a new empty stream. |
const |
readBoolean | Returns the next instance of boolean in the stream and move the read cursor t... |
const |
readInt16 | Returns the next instance of int16 in the stream and move the read cursor to ... |
const |
readInt32 | Returns the next instance of int32 in the stream and move the read cursor to ... |
const |
readInt64 | Returns the next instance of int64 in the stream and move the read cursor to ... |
const |
readInt8 | Returns the next instance of int8 in the stream and move the read cursor to t... |
const |
readNumber | Returns the next instance of number in the stream and move the read cursor to... |
const |
readString | Returns the next instance of string in the stream and move the read cursor to... |
const |
readUInt16 | Returns the next instance of uint16 in the stream and move the read cursor to... |
const |
readUInt32 | Returns the next instance of uint32 in the stream and move the read cursor to... |
const |
readUInt64 | Returns the next instance of uint64 in the stream and move the read cursor to... |
const |
readUInt8 | Returns the next instance of uint8 in the stream and move the read cursor to ... |
const |
remove | Moves the read cursor count bytes forward. The data before this position ca... |
const |
size | Returns the amount of remaining bytes after the read cursor. |
const |
toBase64 | Returns a string containing the Base64 representation of the following bytes ... |
const |
toBase64Url | Returns a string containing the Base64Url representation of the following byt... |
const |
to_std_vector_uint8_t | Returns the pointer to the internal std::vector<uint8_t> instance. |
const |
write | Writes the content of data to the stream. The data can be an instance of in... |
Modifiers | Member | Description |
---|---|---|
final |
d_ptr | Object data |
@ |
g_lib | Global library handle |
def (self, data)
Writes the content of data
to the stream, then returns a reference to
the stream. The data can be an instance of int8, int16, int32,
int64, uint8, uint16, uint32, uint64, number, boolean, string
or none
; otherwise the data is cast to string to get inserted in the
stream.
def (self, data)
Reads some data from the stream and stores it in data
, then returns a
reference to the stream. The amount of data that is read depend on the
type of data
. If the type is int8, int16, int32, int64,
uint8, uint16, uint32, uint64, number, boolean or string, the
corresponding read function is used; otherwise the stream is passed to
the constructor of the type to get the data to store in data
.
def (const self)
Returns true
if the stream contains at least one boolean; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
int16; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
int32; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
int64; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
int8; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
numbers; otherwise
returns false
.
def (const self)
Returns true
if the stream contains at least one string; otherwise
returns false
. A string is detected if the stream contains a byte with
the value 0
.
def (const self, count = 1)
Returns true
if the stream contains at least count
uint16; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
uint32; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
uint64; otherwise
returns false
.
def (const self, count = 1)
Returns true
if the stream contains at least count
uint8; otherwise
returns false
.
null
Object data
def (data)
Creates a new stream containing the data of data
decoded from Base64.
Returns none
if data
is not a valid Base64 string.
def (data)
Creates a new stream containing the data of data
decoded from Base64Url.
Returns none
if data
is not a valid Base64Url string.
def (bytes, count)
Creates a new stream containing the count
first bytes from the bytes
string.
lib ('libmint-serializer')
Global library handle
def (const self)
Returns the next instance of boolean in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self)
Returns the next instance of int16 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of int16 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of int32 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of int32 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of int64 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of int64 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of int8 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of int8 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of number in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self)
Returns the next instance of string in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, from, length = none)
Returns a string constructed with the data starting from the from
byte
after the read cursor. If length
is provided, it is used as a number of
byte to use; otherwise the data is used until the end of the stream. The
constructed string ends at the first byte of value 0
found or where no
more data is available. The read cursor is not modified.
def (const self)
Returns the next instance of uint16 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of uint16 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of uint32 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of uint32 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of uint64 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of uint64 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns the next instance of uint8 in the stream. If the stream does not
contains enough data, none
is returned instead. The read cursor is not
modified.
def (const self, count)
Returns an array containing the next count
instances of uint8 in the
stream. If the stream does not contains enough data, none
is returned
instead. The read cursor is not modified.
def (const self)
Returns true
if the stream has no more data to read; otherwise returns
false
.
def (self)
Creates a new empty stream.
def (self, other)
Creates a new stream containing the data of other
.
If other
is an instance of Serializer.DataStream, this instance is
returned.
If other
provides a toDataStream
method, this method is used to
create the returned value; otherwise other
is sent to the write
method to insert data in the stream.
def (self)
Returns the next instance of boolean in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of int16 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of int32 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of int64 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of int8 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of number in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of string in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of uint16 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of uint32 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of uint64 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self)
Returns the next instance of uint8 in the stream and move the read
cursor to the next byte right after the data. If the stream does not
contains enough data, none
is returned instead and the read cursor
is not modified.
def (self, count)
Moves the read cursor count
bytes forward. The data before this
position can not be reached anymore.
def (const self)
Returns the amount of remaining bytes after the read cursor.
def (const self)
Returns a string containing the Base64 representation of the following bytes in the stream.
def (const self)
Returns a string containing the Base64Url representation of the following bytes in the stream.
def (const self)
Returns the pointer to the internal std::vector<uint8_t>
instance.
def (self, data)
Writes the content of data
to the stream. The data can be an instance
of int8, int16, int32, int64, uint8, uint16, uint32,
uint64, number, boolean, string or none
; otherwise the data is cast
to string to get inserted in the stream.