FMLiveSwitchByteInputStream Class Reference

An buffer of bytes that can be read sequentially. More...

Instance Methods

(int) - available
 Gets the number of available bytes for reading. More...
 
(instancetype) - initWithBytes:
 Initializes a new instance of the FMLiveSwitchByteInputStream class. More...
 
(instancetype) - initWithBytes:offset:
 Initializes a new instance of the FMLiveSwitchByteInputStream class. More...
 
(void) - mark
 Marks the current position for a later reset. More...
 
(int) - read
 Reads a value from the byte array. More...
 
(int) - readWithBuffer:offset:length:
 Reads a segment from the byte array. More...
 
(void) - reset
 Resets the stream to the marked position. More...
 
(int) - skipWithN:
 Advances the stream position by the amount specified. More...
 

Class Methods

(FMLiveSwitchByteInputStream *) + byteInputStreamWithBytes:
 Initializes a new instance of the FMLiveSwitchByteInputStream class. More...
 
(FMLiveSwitchByteInputStream *) + byteInputStreamWithBytes:offset:
 Initializes a new instance of the FMLiveSwitchByteInputStream class. More...
 

Detailed Description

An buffer of bytes that can be read sequentially.

Method Documentation

◆ available

- (int) available

Gets the number of available bytes for reading.

◆ byteInputStreamWithBytes:

+ (FMLiveSwitchByteInputStream*) byteInputStreamWithBytes: (NSMutableData *)  bytes

Initializes a new instance of the FMLiveSwitchByteInputStream class.

Parameters
bytesThe bytes.

◆ byteInputStreamWithBytes:offset:

+ (FMLiveSwitchByteInputStream*) byteInputStreamWithBytes: (NSMutableData *)  bytes
offset: (int)  offset 

Initializes a new instance of the FMLiveSwitchByteInputStream class.

Parameters
bytesThe bytes.
offsetThe offset.

◆ initWithBytes:

- (instancetype) initWithBytes: (NSMutableData *)  bytes

Initializes a new instance of the FMLiveSwitchByteInputStream class.

Parameters
bytesThe bytes.

◆ initWithBytes:offset:

- (instancetype) initWithBytes: (NSMutableData *)  bytes
offset: (int)  offset 

Initializes a new instance of the FMLiveSwitchByteInputStream class.

Parameters
bytesThe bytes.
offsetThe offset.

◆ mark

- (void) mark

Marks the current position for a later reset.

◆ read

- (int) read

Reads a value from the byte array.

Returns
The byte, or -1 if no more bytes are available for reading.

◆ readWithBuffer:offset:length:

- (int) readWithBuffer: (NSMutableData *)  buffer
offset: (int)  offset
length: (int)  length 

Reads a segment from the byte array.

Returns
The number of bytes read.

◆ reset

- (void) reset

Resets the stream to the marked position.

◆ skipWithN:

- (int) skipWithN: (int)  n

Advances the stream position by the amount specified.

Parameters
nThe number of bytes to skip.
Returns
The number of bytes skipped.