Read( ) method (MemoryInputStream)

Reads from a MemoryInputStream object into a CHARACTER, LONGCHAR, or MEMPTR and returns the number of bytes read.

Return type: INT64

Access: PUBLIC

Applies to: Progress.IO.MemoryInputStream class

Syntax

Read(INPUT pmData AS MEMPTR)
Read(INPUT pmData AS MEMPTR, INPUT offset AS INT64, INPUT len AS INT64)
Read(INPUT delimiter AS CHARACTER, OUTPUT lcData AS LONGCHAR)
Read(INPUT delimiter AS CHARACTER, OUTPUT cData AS CHARACTER)
pmData
Specifies a MEMPTR where the data read from a MemoryInputStream object is written until the MEMPTR is filled or until the end of the stream is reached (whichever comes first).
offset
Offset in bytes to the first byte in the MEMPTR.
len
The number of bytes to read from a MemoryInputStream object.
delimiter
A single character that indicates where a read from a MemoryInputStream object should stop. Note that:
  • If you specify a string of more than one character, only the first character is used.
  • If you specify a null string (""), a space character is used as the delimiter.
  • If you specify an alphabetic character, the delimiter is case sensitive.
lcData
The name of a LONGCHAR variable where the data read from a MemoryInputStream object is placed. The AVM returns a runtime error if the total number of bytes read before a delimiter is encountered cannot fit a LONGCHAR expression.
cData
The name of a CHARACTER variable where the data read from a MemoryInputStream object is placed. The AVM returns a runtime error if the total number of bytes read before a delimiter is encountered cannot fit a CHARACTER expression.