Home > Language Reference > Classes
Stream Class
+ Object
+ Stream
Description
The Stream class implements the common behaviour for all streams. This class is neither instantiable nor derivable. You can only instance its derived classes which are StreamFile, StreamFileDB, StreamExg, StreamMemory, StreamNull, StreamSerial, StreamSocket, StreamBluetooth, StreamCipher and StreamComposite.
If you are not familiar with the concept of stream, you should refer to the Streams chapter in the Programmer's Guide for further information.
The Read and Write methods allow reading from and writing to a stream. The Seek method allows positioning of the pointer within a stream. The SeekToBegin and SeekToEnd position the pointer at the beginning or end of a stream. The Position property indicates the current position of the pointer. Finally, the size of a stream is returned by the Size property.
Not all these statements, methods and properties are valid for all types of streams. For example, it is not possible to position the pointer in a serial communication stream, or to write into a file opened in read only mode. The table below recaps the functions available for each type of stream :
| Type of Datastream | Read | Write | Size | Seek / Position |
| StreamNull | Yes | Yes | Yes | Yes |
| StreamMemory | Yes | Yes | Yes | Yes |
| StreamRecord | Yes | Yes | Yes | Yes |
| StreamExg | Yes (1) | Yes (1) | No | No |
| StreamSerial | Yes | Yes | No | No |
| StreamSocket | Yes | Yes | No | No |
| StreamBluetooth | Yes | Yes | No | No |
| StreamFile | Yes (2) | Yes (2) | Yes | Yes |
| StreamFileDB | Yes (2) | Yes (2) | Yes | Yes |
| StreamCipher | Yes (2) | Yes (2) | No | No |
| StreamComposite | Yes | No | Yes | Yes |
(1) Read is allowed when the stream is received via the ExgReceive event. Write is allowed when the Connect method has been used.
(2) Depending on the open mode.
If you try to use a method or property on a stream that does not supported this functionality, a runtime error occurs.
Members
| Members | Description |
| Position | Stream pointer position. |
| Read | Reads data from a stream. |
| Seek | Moves the stream pointer. |
| SeekToBegin | Moves the pointer to the beginning of the stream. |
| SeekToEnd | Moves the pointer to the end of the stream. |
| Size | Total size of the data in a stream. |
| Write | Writes data to a stream. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |