Diffusion Apple API  5.9.24
Unified Client Library for iOS, OS X and tvOS
 All Classes Functions Variables Properties Pages
Class Methods | Instance Methods | List of all members
PTDiffusionBinary Class Reference

Introduction

An immutable binary value with support for binary deltas.

Since
5.9
Inheritance diagram for PTDiffusionBinary:
PTDiffusionBytes

Class Methods

(PTDiffusionValueStream *) + valueStreamWithDelegate:
 

Instance Methods

(nullable PTDiffusionBinary *) - applyDelta:error:
 
(PTDiffusionBinaryDelta *) - diffFromBinary:
 
(BOOL) - isEqualToBinary:
 
- Instance Methods inherited from PTDiffusionBytes
(instancetype) - initWithData:
 
(BOOL) - isEqualToBytes:
 

Additional Inherited Members

- Properties inherited from PTDiffusionBytes
NSData * data
 

Method Documentation

- (nullable PTDiffusionBinary *) applyDelta: (PTDiffusionBinaryDelta *)  delta
error: (NSError **)  error 

Apply a binary delta to the receiver's binary value to create a new value.

Parameters
deltaThe delta describing the changes to be applied to the receiver's value in order to create the value to be returned.
errorLocation to store a reason if this method returns nil to indicate failure.
Returns
The new binary value or nil if there was a failure when applying the delta (e.g. either the delta is invalid).
Exceptions
NSInvalidArgumentExceptionRaised if the delta argument is nil.
Since
5.9
- (PTDiffusionBinaryDelta *) diffFromBinary: (PTDiffusionBinary *)  binary

Compare the receiver's binary value with another (e.g. an earlier version) to create a binary delta.

Parameters
binaryThe original to which the delta should be able to be applied in order to generate the value represented by the receiver.
Returns
A binary delta representing the difference between binary and the receiver.
Exceptions
NSInvalidArgumentExceptionRaised if the binary argument is nil.
Since
5.9
- (BOOL) isEqualToBinary: (nullable PTDiffusionBinary *)  binary

Compares the receiver to the given binary.

Parameters
binaryThe binary object with which to compare the receiver.
Returns
YES if the data in binary is equal to the contents of the receiver, otherwise NO.
Note
Two binary objects are equal if they hold the same number of data bytes, and if the bytes at the same position in the objects are the same.
Since
5.9
+ (PTDiffusionValueStream *) valueStreamWithDelegate: (id< PTDiffusionBinaryValueStreamDelegate >)  delegate

Creates a value stream capable of receiving binary values.

Parameters
delegateThe object which will handle the incoming stream. A weak reference is maintained to this object by the value stream.
Returns
A value stream associated with the supplied delegate.
Exceptions
NSInvalidArgumentExceptionRaised if the delegate argument is nil.
Since
5.9