ByteVector Overview

A Byte Vector (ByteVector) is a Heap object containing zero or more 8 bit data values. The ByteVector object is NOT restricted to ASCII data and may contain any configuration of 8 bit data values

The ByteVector is a dynamic data type: it can grow to containing new elements or contract as elements are deleted. An element is accessed by an index from 0 to n-1 where n is the number of elements in the ByteVector. When an element is added, it is appended to the end.

(setq newBytes (new Vector: Byte: 100))
(appendWriteln newBytes {An example of a ByteVector})

When to Use

The ByteVector is a subtype of the Vector Data Type. The FltVector object is useful for storing ASCII data and 8 bit data values such as String and Text.

Constant Form

The ByteVector data type has no constant form unlike other Vector subtypes. A ByteVector is diplayed as is.

For Example:

(setq newBytes (new Vector: Byte: 100))
(appendWriteln newBytes {An example of a ByteVector})
(display newBytes)
Returns: An example of a ByteVector

Object Data Types

The ByteVector is a Heap Object or an Object Data Type. The Analytic Information Server Object Types are stored in the Heap and are managed by the Heap manager. The Analytic Information Server Heap manager supports object resizing, garbage collection, and anti-fragmentation algorithms so that the user may concentrate on the analysis and modeling of data rather than on memory management. Without exception, all of the Object types are identified by an object id. The object id identifies a block of memory, managed by the Lambda Information Server memory manager, in which the Object's data is stored.

The Analytic Information Server Heap Object and Native Data types can be saved and loaded to and from persistent (disk file) storage at any time. Containers with immediate data are saved on disk in fixed length records equal to the size of the container. Containers with Heap object references are saved in fixed length records, which are automatically expanded to include the contents of the Heap object, and any objects referenced by the Heap object, etc. This feature is called Object Closure Management and is automatic with every Analytic Information Server container database save.

Analytic Information Server containers may be loaded from any database repository record at any time. If the data in the record is immediate, the database load fills the container with the immediate data. If the data in the record is an object closure, the database load fills the container with a Heap object reference, and all of the objects in the record are loaded back into the Heap with the same referential relationships they had when they were saved in the repository.


Data Type Functions

The ByteVector object can be demonstrated by the following functions.

appendWriteln compress decode display
encode fdisplay fileClose fileDisplay
fileErase fileOpen fileReadRecord fileRead
fileResize fileSeek fileWrite filewriteln
isByteVector isCharAlphabetic isCharAlphanumeric isCharLowercase
isCharName isCharNumeric isCharUppercase isCharWhitespace
isObject loadObject new run
saveObject sizeof system type
uncompress writeln


Data Type Examples

The ByteVector object can be demonstrated by the following examples.

Example_ByteVector_appendWriteln_001 Example_ByteVector_compress_001 Example_ByteVector_isByteVector_001 Example_ByteVector_isCharAlphabetic_003
Example_ByteVector_isCharAlphanumeric_003 Example_ByteVector_isCharLowercase_003 Example_ByteVector_isCharName_003 Example_ByteVector_isCharNumeric_003
Example_ByteVector_isCharUppercase_003 Example_ByteVector_isCharWhitespace_003 Example_ByteVector_isObject_013 Example_ByteVector_new_015
Example_ByteVector_sizeof_020 Example_ByteVector_type_022