DABin2DataStreamer

Overview

Concrete implementation of a DADataStreamer, providing the standard Data Abstract Bin2DataStreamer protocol implementation.

Location

 

data    (declared in DADataStreamer)

Represents the bytes buffer that holds serialized data. Returns nil for this abstract class.

@property (readonly) NSData *data

dataStreamerWithData:

Class method that creates and initialized DABin2DataStreamer instance with given NSData instance

+ (id) dataStreamerWithData:(NSData *)data

Parameters:

  • data:

finalizeStreamer    (declared in DADataStreamer)

Finalizes an opened streamer. After finalization, the streamer mode is always set to None.

- (void) finalizeStreamer

getDataTable:

For internal use only. Deserializes and returns an instance of a DADataTable with the given table name from the internal data buffer.

- (DADataTable *) getDataTable:(NSString *)tableName

Parameters:

  • tableName:

initializeStreamerWithMode:andData:    (declared in DADataStreamer)

Returns an instance of DADataStreamer initialized with the given mode and the given data buffer.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.

initializeStreamerWithMode:andData:andOffset:    (declared in DADataStreamer)

Initializes a streamer instance with the given mode, data buffer and offset.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.
  • anOffset: Start position inside the given bytes buffer.

initWithData:

Initializes a new DABin2DataStreamer with the provided data buffer.

- (id) initWithData:(NSData *)data

Parameters:

  • data:

initWithData:offset:

Initializes a new DABin2DataStreamer with data at a specific offset within the provided data buffer.

- (id) initWithData:(NSData *)data offset:(int)offset

Parameters:

  • data:
  • offset:

readDataTable:toTable:    (declared in DADataStreamer)

Reads the structure and data of a DADataTable with given name from the data stream into DADataTable.

- (void) readDataTable:(NSString *)tableName toTable:(DADataTable *)table

Parameters:

  • tableName: Name of the table which we want to obtain from the data stream. If stream does not contain table with such name then DA Exception will be raised.
  • table: DADataTable instance to where we read structure and data from the data stream

readDelta:forTable:    (declared in DADataStreamer)

Reads the delta object for the given table from the serialized buffer.

- (void) readDelta:(DADelta *)aDelta forTable:(DADataTable *)table

Parameters:

  • aDelta: Instance of the DADelta to read.
  • table: Instance of the DADataTable that holds the delta.

sourceData

For internal use only. Provides a reference to the ROBinReaderWriter instance used to serialize/deserialize data to and from the internal binary format.

@property (readonly) ROBinReaderWriter *sourceData

streamerMode    (declared in DADataStreamer)

Returns one of the following streamer modes: Reading, Reading from beginning, Writing or None.

@property (readonly) enum DAStreamerMode streamerMode

tableNames    (declared in DADataStreamer)

Returns an array of all names of the tables serialized in the current bytes buffer.

@property (readonly) NSArray *tableNames

writeChangesForTable:    (declared in DADataStreamer)

Extracts changes for the given table and serializes them to the streamer bytes buffer.

- (void) writeChangesForTable:(DADataTable *)table

Parameters:

  • table: Reference to the changes we want to serialize.

writeDataTable:    (declared in DADataStreamer)

Serializes table data with the table schema to the streamer bytes buffer.

- (void) writeDataTable:(DADataTable *)table

Parameters:

  • table: Reference to the DADataTable we want to serialize.

writeDataTables:

For internal use only. Serializes the passed array of DADataTables into binary format and returns the result as a NSData buffer of raw data.

+ (NSData *) writeDataTables:(NSArray *)tables

Parameters:

  • tables:

writeDelta:    (declared in DADataStreamer)

method serializes given DADelta to the DADeltaStreamer

- (void) writeDelta:(DADelta *)aDelta

Parameters:

  • aDelta: DADelta instance we want to serialize to the DADeltaStreamer

writeTable:ToData:

For internal use only. Serializes a single DADataTable into the provided buffer.

+ (void) writeTable:(DADataTable *)table ToData:(NSMutableData *)data

Parameters:

  • table:
  • data:

 

data    (declared in DADataStreamer)

Represents the bytes buffer that holds serialized data. Returns nil for this abstract class.

@property (readonly) NSData *data

sourceData

For internal use only. Provides a reference to the ROBinReaderWriter instance used to serialize/deserialize data to and from the internal binary format.

@property (readonly) ROBinReaderWriter *sourceData

streamerMode    (declared in DADataStreamer)

Returns one of the following streamer modes: Reading, Reading from beginning, Writing or None.

@property (readonly) enum DAStreamerMode streamerMode

tableNames    (declared in DADataStreamer)

Returns an array of all names of the tables serialized in the current bytes buffer.

@property (readonly) NSArray *tableNames

 

dataStreamerWithData:

Class method that creates and initialized DABin2DataStreamer instance with given NSData instance

+ (id) dataStreamerWithData:(NSData *)data

Parameters:

  • data:

writeDataTables:

For internal use only. Serializes the passed array of DADataTables into binary format and returns the result as a NSData buffer of raw data.

+ (NSData *) writeDataTables:(NSArray *)tables

Parameters:

  • tables:

writeTable:ToData:

For internal use only. Serializes a single DADataTable into the provided buffer.

+ (void) writeTable:(DADataTable *)table ToData:(NSMutableData *)data

Parameters:

  • table:
  • data:

 

finalizeStreamer    (declared in DADataStreamer)

Finalizes an opened streamer. After finalization, the streamer mode is always set to None.

- (void) finalizeStreamer

getDataTable:

For internal use only. Deserializes and returns an instance of a DADataTable with the given table name from the internal data buffer.

- (DADataTable *) getDataTable:(NSString *)tableName

Parameters:

  • tableName:

initializeStreamerWithMode:andData:    (declared in DADataStreamer)

Returns an instance of DADataStreamer initialized with the given mode and the given data buffer.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.

initializeStreamerWithMode:andData:andOffset:    (declared in DADataStreamer)

Initializes a streamer instance with the given mode, data buffer and offset.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.
  • anOffset: Start position inside the given bytes buffer.

initWithData:

Initializes a new DABin2DataStreamer with the provided data buffer.

- (id) initWithData:(NSData *)data

Parameters:

  • data:

initWithData:offset:

Initializes a new DABin2DataStreamer with data at a specific offset within the provided data buffer.

- (id) initWithData:(NSData *)data offset:(int)offset

Parameters:

  • data:
  • offset:

readDataTable:toTable:    (declared in DADataStreamer)

Reads the structure and data of a DADataTable with given name from the data stream into DADataTable.

- (void) readDataTable:(NSString *)tableName toTable:(DADataTable *)table

Parameters:

  • tableName: Name of the table which we want to obtain from the data stream. If stream does not contain table with such name then DA Exception will be raised.
  • table: DADataTable instance to where we read structure and data from the data stream

readDelta:forTable:    (declared in DADataStreamer)

Reads the delta object for the given table from the serialized buffer.

- (void) readDelta:(DADelta *)aDelta forTable:(DADataTable *)table

Parameters:

  • aDelta: Instance of the DADelta to read.
  • table: Instance of the DADataTable that holds the delta.

writeChangesForTable:    (declared in DADataStreamer)

Extracts changes for the given table and serializes them to the streamer bytes buffer.

- (void) writeChangesForTable:(DADataTable *)table

Parameters:

  • table: Reference to the changes we want to serialize.

writeDataTable:    (declared in DADataStreamer)

Serializes table data with the table schema to the streamer bytes buffer.

- (void) writeDataTable:(DADataTable *)table

Parameters:

  • table: Reference to the DADataTable we want to serialize.

writeDelta:    (declared in DADataStreamer)

method serializes given DADelta to the DADeltaStreamer

- (void) writeDelta:(DADelta *)aDelta

Parameters:

  • aDelta: DADelta instance we want to serialize to the DADeltaStreamer