Write( ) method (MemoryOutputStream)
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Writes data from specified input parameters to a MemoryOutputStream object. Returns the total number of characters written for CHARACTER and LONGCHAR data parameter, or the total number of bytes written for a MEMPTR parameter.
Return type: INT64
Access: PUBLIC
Applies to:Progress.IO.MemoryOutputStream class
Syntax
|
- source-data
- A CHARACTER, LONGCHAR, or MEMPTR variable containing the data the
method will write to the MemoryOutputStream object.Note: The AVM converts LONGCHAR data values to the code page specified by the
-cpinternalparameter. - offset
- Indicates which byte of the source-data MEMPTR the method should start with when writing to the current MemoryOutputStream object.
- length
- Number of bytes to write to the MemoryOutputStream object.
- incldNull
- If set to
TRUE, includes the null terminator in CHARACTER or LONGCHAR data written to the current MemoryOutputStream object.
Example
|
Note
The following table illustrates values that result from constructors and
Write( )/Clear( )
methods:
| Method/Constructor | Values | |
| Obj:Length | Obj:BytesWritten | |
Obj = NEW
MemoryOutputStream() |
0 | 0 |
Obj:Write(“12345”) |
5 | 5 |
Obj:Clear() |
0 | 0 |
Obj = NEW
MemoryOutputStream(100) |
100 | 0 |
Obj:Write(“12345678”) |
100 | 8 |
Obj:Clear() |
100 | 0 |