ADO StreamObject


Stream Object (ADO version 2.5)

The ADO Stream object is used to read, write, and manage binary data or text streams.

The Stream object can be obtained in three ways:

  • By pointing to a URL that contains an object (usually a file) with binary or text data. This object can be a simple document, a Record object representing a structured document, or a folder.
  • By instantiating a Stream object. These Stream objects can be used to store data for an application. Unlike a Stream associated with a URL or the default Stream of a Record, an instantiated Stream is not associated with an underlying source by default.
  • By opening the default Stream object associated with a Record object. When a Record is opened, the default stream associated with the Record object is available. Simply opening that stream eliminates a round trip.

Syntax

objectname.property
objectname.method


Properties

Property Description
CharSet Specifies the character set used to store the Stream.
EOS Returns whether the current position is at the end of the stream.
LineSeparator Sets or returns the line separator used in a text Stream object.
Mode Sets or returns the available permissions for modifying data.
Position Sets or returns the current position from the beginning of the Stream object (in bytes).
Size Returns the size of an open Stream object.
State Returns a value describing whether the Stream is open or closed.
Type Sets or returns the type of data in the Stream object.

Methods

Method Description
Cancel Cancels the execution of an Open call on a Stream object.
Close Closes a Stream object.
CopyTo Copies a specified number of characters/bits from one Stream object to another Stream object.
Flush Sends the contents of the Stream buffer to an associated underlying object.
LoadFromFile Loads the contents of a file into a Stream object.
Open Opens a Stream object.
Read Reads the entire stream or a specified number of bytes from a binary Stream object.
ReadText Read an entire stream, a line, or a specified number of bytes from a text Stream object.
SaveToFile Save the binary content of a Stream object to a file.
SetEOS Set the current position to the end of the stream (EOS)
SkipLine Skip a line when reading a text stream.
Write Write binary data to a binary Stream object.
WriteText Write character data to a text Stream object.
Other extensions