FMLiveSwitchMatroskaElement Class Reference

A Matroska element. More...

Instance Methods

(NSMutableData *) - getBytes
 Serializes to a byte array. More...
 
(NSMutableData *) - getInnerBytes
 Gets the inner bytes. More...
 
(NSMutableData *) - id
 Gets the EBML ID. More...
 
(instancetype) - init
 
(int) - length
 Gets the total length of the element (including ID/size field), set after calling getBytes. More...
 
(void) - setSizeLength:
 Sets the length of the size field, in bytes. More...
 
(void) - setWriteDefaultValues:
 Sets whether to include default values when serializing. More...
 
(int) - size
 Gets the size of the element (excluding ID/size field), set after calling getBytes. More...
 
(int) - sizeLength
 Gets the length of the size field, in bytes. More...
 
(void) - write:id:stream:
 Writes a binary element to the stream. More...
 
(void) - writeBool:id:stream:
 Writes a boolean element to the stream. More...
 
(void) - writeDate:id:stream:
 Writes a date element to the stream. More...
 
(bool) - writeDefaultValues
 Gets whether to include default values when serializing. More...
 
(void) - writeDouble:id:stream:
 Writes a double element to the stream. More...
 
(void) - writeFloat:id:stream:
 Writes a float element to the stream. More...
 
(void) - writeGuid:id:stream:
 Writes a GUID element to the stream. More...
 
(void) - writeSignedInteger:id:stream:
 Writes an signed integer element to the stream. More...
 
(void) - writeString:id:stream:
 Writes an ASCII string element to the stream. More...
 
(void) - writeUnsignedInteger:id:stream:
 Writes an unsigned integer element to the stream. More...
 
(void) - writeUtf8:id:stream:
 Writes a UTF-8 string element to the stream. More...
 
(void) - writeVariableInteger:stream:
 Writes a variable integer ("vint") to the stream. More...
 
(void) - writeVariableInteger:stream:length:
 Writes a variable integer ("vint") to the stream using a fixed length. More...
 

Class Methods

(bool) + compareWithBytes1:bytes2:
 Compares two byte arrays for equality. More...
 
(FMLiveSwitchMatroskaElement *) + element
 
(bool) + readBool:
 Reads a boolean element from the stream. More...
 
(NSDate *) + readDate:
 Reads a date string element from the stream. More...
 
(double) + readDouble:
 Reads a double element from the stream. More...
 
(float) + readFloat:
 Reads a float element from the stream. More...
 
(FMLiveSwitchGuid *) + readGuid:
 Reads a GUID element from the stream. More...
 
(NSMutableData *) + readIdWithBytes:offset:offsetPlus:
 Reads a binary ID from the stream. More...
 
(long long) + readSignedInteger:
 Reads a signed integer element from the byte array. More...
 
(NSString *) + readString:
 Reads an ASCII string element from the stream. More...
 
(long long) + readUnsignedInteger:
 Reads an unsigned integer element from the byte array. More...
 
(NSString *) + readUtf8:
 Reads a UTF-8 string element from the stream. More...
 
(NSMutableData *) + readValueWithBytes:offset:offsetPlus:
 Reads a binary value from the stream. More...
 
(long long) + readVariableIntegerWithBytes:offset:offsetPlus:
 Reads a variable integer ("vint") from the byte array. More...
 
(NSMutableData *) + serializeVariableInteger:
 Serializes a variable integer. More...
 
(NSMutableData *) + serializeVariableInteger:length:
 Serializes a variable integer using a fixed length. More...
 

Detailed Description

A Matroska element.

Method Documentation

◆ compareWithBytes1:bytes2:

+ (bool) compareWithBytes1: (NSMutableData *)  bytes1
bytes2: (NSMutableData *)  bytes2 

Compares two byte arrays for equality.

Parameters
bytes1The first byte array.
bytes2The second byte array.

◆ element

◆ getBytes

- (NSMutableData*) getBytes

Serializes to a byte array.

◆ getInnerBytes

◆ id

◆ init

◆ length

- (int) length

Gets the total length of the element (including ID/size field), set after calling getBytes.

◆ readBool:

+ (bool) readBool: (NSMutableData *)  value

Reads a boolean element from the stream.

Parameters
valueThe value.

◆ readDate:

+ (NSDate*) readDate: (NSMutableData *)  value

Reads a date string element from the stream.

Parameters
valueThe value.

◆ readDouble:

+ (double) readDouble: (NSMutableData *)  value

Reads a double element from the stream.

Parameters
valueThe value.

◆ readFloat:

+ (float) readFloat: (NSMutableData *)  value

Reads a float element from the stream.

Parameters
valueThe value.

◆ readGuid:

+ (FMLiveSwitchGuid*) readGuid: (NSMutableData *)  value

Reads a GUID element from the stream.

Parameters
valueThe value.

◆ readIdWithBytes:offset:offsetPlus:

+ (NSMutableData*) readIdWithBytes: (NSMutableData *)  bytes
offset: (int)  offset
offsetPlus: (int *)  offsetPlus 

Reads a binary ID from the stream.

Parameters
bytesThe byte array.
offsetThe offset into the byte array.
offsetPlusThe offset plus the amount read.

◆ readSignedInteger:

+ (long long) readSignedInteger: (NSMutableData *)  value

Reads a signed integer element from the byte array.

Parameters
valueThe value.

◆ readString:

+ (NSString*) readString: (NSMutableData *)  value

Reads an ASCII string element from the stream.

Parameters
valueThe value.

◆ readUnsignedInteger:

+ (long long) readUnsignedInteger: (NSMutableData *)  value

Reads an unsigned integer element from the byte array.

Parameters
valueThe value.

◆ readUtf8:

+ (NSString*) readUtf8: (NSMutableData *)  value

Reads a UTF-8 string element from the stream.

Parameters
valueThe value.

◆ readValueWithBytes:offset:offsetPlus:

+ (NSMutableData*) readValueWithBytes: (NSMutableData *)  bytes
offset: (int)  offset
offsetPlus: (int *)  offsetPlus 

Reads a binary value from the stream.

Parameters
bytesThe byte array.
offsetThe offset into the byte array.
offsetPlusThe offset plus the amount read.

◆ readVariableIntegerWithBytes:offset:offsetPlus:

+ (long long) readVariableIntegerWithBytes: (NSMutableData *)  bytes
offset: (int)  offset
offsetPlus: (int *)  offsetPlus 

Reads a variable integer ("vint") from the byte array.

Parameters
bytesThe byte array.
offsetThe offset into the byte array.
offsetPlusThe offset plus the amount read.

◆ serializeVariableInteger:

+ (NSMutableData*) serializeVariableInteger: (long long)  value

Serializes a variable integer.

Parameters
valueThe value.

◆ serializeVariableInteger:length:

+ (NSMutableData*) serializeVariableInteger: (long long)  value
length: (int)  length 

Serializes a variable integer using a fixed length.

Parameters
valueThe value.
lengthThe length to use.

◆ setSizeLength:

- (void) setSizeLength: (int)  value

Sets the length of the size field, in bytes.

Defaults to zero (variable size).

◆ setWriteDefaultValues:

- (void) setWriteDefaultValues: (bool)  value

Sets whether to include default values when serializing.

◆ size

- (int) size

Gets the size of the element (excluding ID/size field), set after calling getBytes.

◆ sizeLength

- (int) sizeLength

Gets the length of the size field, in bytes.

Defaults to zero (variable size).

◆ write:id:stream:

- (void) write: (NSMutableData *)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a binary element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeBool:id:stream:

- (void) writeBool: (bool)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a boolean element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeDate:id:stream:

- (void) writeDate: (NSDate *)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a date element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeDefaultValues

- (bool) writeDefaultValues

Gets whether to include default values when serializing.

◆ writeDouble:id:stream:

- (void) writeDouble: (double)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a double element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeFloat:id:stream:

- (void) writeFloat: (float)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a float element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeGuid:id:stream:

- (void) writeGuid: (FMLiveSwitchGuid *)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a GUID element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeSignedInteger:id:stream:

- (void) writeSignedInteger: (long long)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes an signed integer element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeString:id:stream:

- (void) writeString: (NSString *)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes an ASCII string element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeUnsignedInteger:id:stream:

- (void) writeUnsignedInteger: (long long)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes an unsigned integer element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeUtf8:id:stream:

- (void) writeUtf8: (NSString *)  value
id: (NSMutableData *)  idValue
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a UTF-8 string element to the stream.

Parameters
valueThe value to write.
idValueThe ID of the value.
streamThe stream to write.

◆ writeVariableInteger:stream:

- (void) writeVariableInteger: (long long)  value
stream: (FMLiveSwitchByteOutputStream *)  stream 

Writes a variable integer ("vint") to the stream.

Parameters
valueThe value to write.
streamThe stream to write.

◆ writeVariableInteger:stream:length:

- (void) writeVariableInteger: (long long)  value
stream: (FMLiveSwitchByteOutputStream *)  stream
length: (int)  length 

Writes a variable integer ("vint") to the stream using a fixed length.

Parameters
valueThe value to write.
streamThe stream to write.
lengthThe length to use.