The technical specifications are at DataSpecs

Data Access from the Source class

Each source class object can contain one or more Data objects. These objects contain the actual data that is stored within the Talia system.

All data is encapsulated in Objects which are instances of the Data class, or of subclasses of it.

Accessing the data objects

Data for a source can be accessed by calling source.data, which will return an array with the Source's data objects.

If not data exists, this will return an empty array.

Using the data objects

A data object will always provide at least the following methods:

  • mime_type - returns a representation of the object's MIME type
  • checksum - Note: Still to be done
  • size - returns the size of the object in bytes
  • position - returns the current position of the read cursor
  • get_byte - returns the next byte from the object, or nil at EOS
  • all_bytes - returns all bytes in the object as an array
  • seek - adjust the position of the read cursor
  • reset - reset the cursor to the initial state
  • each_byte - an iterator that calls a block on each byte in the object

Depending on the type of the data object, subclasses of Data may provide additional methods. For example, a text object could provide a get_line method, etc.

If the user wants to use the additional methods, he has to check for the Data object's type and/or MIME type.

Checksums/Integrity

Note: Still to be done