Examples: NotesStream class
This agent creates a stream, writes to it the text value of the Body item of the selected document, changes position in the stream, and reads the stream.
Sub Initialize
Dim session As NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim stream As NotesStream
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
REM Create stream and display properties
Set stream = session.CreateStream
Messagebox "Bytes = " & stream.Bytes & Chr(13) & _
"Charset = " & stream.Charset & Chr(13) & _
"IsEOS = " & stream.IsEOS & Chr(13) & _
"Position = " & stream.Position,, "After creating stream"
REM Write text of Body item to stream and display properties
Call stream.WriteText(doc.GetItemValue("Body")(0))
Messagebox "Bytes = " & stream.Bytes & Chr(13) & _
"Charset = " & stream.Charset & Chr(13) & _
"IsEOS = " & stream.IsEOS & Chr(13) & _
"Position = " & stream.Position,, "After writing to stream"
REM Set position to 0 and display properties
stream.Position = 0
Messagebox "Bytes = " & stream.Bytes & Chr(13) & _
"Charset = " & stream.Charset & Chr(13) & _
"IsEOS = " & stream.IsEOS & Chr(13) & _
"Position = " & stream.Position,, _
"After setting position of stream"
REM Read text from stream
Messagebox stream.ReadText(),, "Text read from stream"
End Sub