SophiaFramework UNIVERSE 5.3 |
In SophiaFramework UNIVERSE, the below is the method to read / write data from / into the storage such as file, network, memory and so on by using the stream.
Method to read / write data through the stream
Stream Classification | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The stream can be classified as follows: Table 17.1. Kind of the Stream 1
Table 17.2. Kind of the Stream 2
|
Concrete Stream Classes
There are eight types of the concrete stream classes as in the below table. These stream classes will read / write data from / into the storage through the stream buffer. The extractor(>> operator) and inserter(<< operator) which will support the various data types and the function to convert the endian are available too.
Table 17.3. Concrete Stream Classes
Kind of the Stream | Kind of the data to read / write | For Reading | For Writing |
---|---|---|---|
String Stream | String of the AChar Type | SFXAnsiStringStreamReader | SFXAnsiStringStreamWriter |
String Stream | String of the WChar Type | SFXWideStringStreamReader | SFXWideStringStreamWriter |
Binary Stream | Binary(Data of the Arbitrary Type) | SFXBinaryStreamReader | SFXBinaryStreamWriter |
Variable Buffer Stream | String of the AChar Type / String of the WChar Type / Binary(Data of the Arbtrary Type) | SFXElasticStreamReader | SFXElasticStreamWriter |
About AChar and WChar | |
---|---|
In the BREW environment, there are two kinds of character types: one is the char type that represents the single/multi byte character(or the ANSI character) and the other is the AECHAR type that represents the double byte character of the uint16 type. In SophiaFramewok UNIVERSE, these two kinds of character types are defined as AChar and WChar using typedef respectively. And two kinds of the following string classes are available:
All the functions of these two string classes are the same except their string types. |
Variable Buffer Stream | |
---|---|
The variable buffer stream is internally used to read / write through the string stream or the binary stream, whose buffer is variable. You don't have to use directly the SFXElasticStreamReader / SFXElasticStreamWriter class as the substance of the variable buffer stream. The variable buffer stream can be gotten by calling the GetStreamReader / GetStreamWriter function of the storage class with the size argument (buffer size) not specified. |
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |