property LastModified as %TimeStamp [ Calculated , ReadOnly ];
Inherited description: LastModified is a read-only property containing the %TimeStamp of
the last modification to this stream. If the stream is null then it will report "".
Inherited description: Type of line terminator we use for this stream, defaults to Cr/Lf. Maximum length is 10 characters.
This is stored as an attribute of the stream called 'LineTerminator'.
Inherited description: Size is a read-only property containing the current size of the stream (in bytes
for a binary stream and characters for a character stream).
If a specific stream implementation cannot determine the size of the stream then
Size will be equal to -1.
VMS does not support moving to a position in a file or providing the current position in a file.
On VMS if a BOM is included at the start of the file it may be included in the size calculated.
Inherited description: Clear the contents of this Stream from permanent storage. This will remove the permanent stream storage and
any temporary stream and initialise the stream to its initial state that it starts in, including removing all
the stream attributes.
Returns a %Status value indicating success or failure.
Inherited description: Copy the stream from source into the current stream ignoring anything already in the current stream
and save the result to the permanent location. This is used to optimise the copying of say a
%GlobalCharacterStream to another %GlobalCharacterStream to avoid copying into
temporary storage first and then moving this to the permanent storage when SaveStream() is called.
Note that any locking or transaction handling must be done by the caller.
Find the first occurrence of target in the stream starting the
search at position. It returns the position at this match starting
at the beginning of the stream. If it does not find the target string then
return -1. If position=-1 then start searching from the current
location and just return the offset from the last search, useful for searching
through the entire file. If you are doing this you should pass in tmpstr
by reference in every call which is used as a temporary location to store information
being read so the next call will start where the last one left off.
Input len characters from the current device into the stream. This is equivalent to doing a series of
reads and calling Write() for each of them but it may be optimised by the subclasses. On return
len will be the number of characters still to read in (if no timeout has occured this should be 0).
Inherited description: Move to this position in the stream. If this suceeds then return
true, else return false. Note this implementation is not efficient because it
searches from the start of the stream, it can be improved upon in specific subclasses.
Note that moving to position 1 will be at the start of the stream, position 2 will be
at the second character of the stream, etc.
Inherited description: Move to the end of the stream so the next Write will be appended to the end.
This allows you to read from a stream, then MoveToEnd() and append new data, where just calling
Write() after a read will clear the stream before writing new data.
Returns a %Status value indicating success or failure.
method OutputToDevice(ByRef len As %Integer = -1) as %Status
Write out len characters of the stream to the current device starting from the current position. This
method is optimised for performance by the various sub classes. If len is omitted or set to -1 then
it will write out the entire stream starting at the beginning.
Output the stream to the current device starting at position of length
length. The length if passed by reference returns the number of characters
output.
Inherited description: Reads up to len characters from the current position
in the stream. The current position is advanced by the number of
characters read. Upon exit, len is set to the actual
number of characters read. If a read occurs when the stream position
is at the end of the stream, len will be set to -1 and
Read() will return a null string (""). If no len
is passed in, ie. 'Read()' then it is up to the Read implementation as to
how much data to return. Some stream classes use this to optimize the amount of
data returned to align this with the underlying storage of the stream.
You must call Rewind() if you want to read a stream from the beginning
again. Calling Read() after Write() implicitly ends the Write()
operation and rewinds to the start of the stream.
Returns a string up to len characters long. The byref argument sc will
return a %Status if any error occurred during the read.
Inherited description: Read a line from the stream. This will look for the line terminator in the stream and
once it finds the terminator it will return the string minus the terminator character/s. If it reaches the
end of the stream before it finds a terminator it will return the data it has so far, and if you specify a
maximum size in len it will only read up to this number of characters. On exit len
will contain the actual number of characters read. The byref argument sc will
return a %Status if any error occured during the read and the byref argument eol
is true if it found the line terminator and false otherwise. So for example you can read in a stream
a line at a time and output the results to the current device with:
While 'stream.AtEnd { Write stream.ReadLine(,.sc,.eol) If $$$ISERR(sc) { Write "ERROR" Quit } If eol { Write ! } }
Inherited description: This reads from the stream until it find the LineTerminator and returns
this as a stream. If the stream does not contain the line terminator this can potentially be the
entire stream.
Appends the string data along with a line terminator to the stream and advances the
current stream position by the number of characters in data plus the line terminator.
Returns a %Status value indicating success or failure.