HexFiend: HFSharedMemoryByteSlice Class Reference

HexFiend

Instance Methods | List of all members
HFSharedMemoryByteSlice Class Reference
Model

A subclass of HFByteSlice for working with data stored in memory. More...

Inheritance diagram for HFSharedMemoryByteSlice:

## Instance Methods
(instancetype) | - initWithUnsharedData:
(instancetype) | - initWithData:
(instancetype) | - initWithData:offset:length:
Instance Methods inherited from HFByteSlice
(unsigned long long) | - length
(void) | - copyBytes:range:
(HFByteSlice *) | - subsliceWithRange:
(HFByteSlice *) | - byteSliceByAppendingSlice:
(BOOL) | - isSourcedFromFile
(HFRange) | - sourceRangeForFile:
(HFByteRangeAttributeArray *) | - attributesForBytesInRange:

## Detailed Description

HFSharedMemoryByteSlice is a subclass of HFByteSlice that represents a portion of data from memory, e.g. typed or pasted in by the user. The term "shared" refers to the ability for mutiple HFSharedMemoryByteSlices to reference the same NSData; it does not mean that the data is in shared memory or shared between processes.

Instances of HFSharedMemoryByteSlice are immutable (like all instances of HFByteSlice). However, to support efficient typing, the backing data is an instance of NSMutableData that may be grown. A referenced range of the NSMutableData will never have its contents changed, but it may be allowed to grow larger, so that the data does not have to be copied merely to append a single byte. This is implemented by overriding the -byteSliceByAppendingSlice: method of HFByteSlice.

## Method Documentation

## § initWithUnsharedData:()

- (instancetype) initWithUnsharedData: |  | (NSData *) | data |

## § initWithData:()

- (instancetype) initWithData: |  | (NSMutableData *) | data |

## § initWithData:offset:length:()

- (instancetype) initWithData: |  | (NSMutableData *) | data
offset: |  | (NSUInteger) | offset
length: |  | (NSUInteger) | length

The documentation for this class was generated from the following file:

- HFSharedMemoryByteSlice.h