FMLiveSwitchUtf8 Class Reference

UTF-8 encoding/decoding utility. More...

Instance Methods

(instancetype) - init
 

Class Methods

(NSString *) + decodeWithBuffer:
 Decodes a UTF-8 data buffer to a string. More...
 
(NSString *) + decodeWithInput:
 Decodes a UTF-8 byte array to a string. More...
 
(NSString *) + decodeWithInput:index:length:
 Decodes a UTF-8 byte array to a string. More...
 
(NSMutableData *) + encodeWithInput:
 Encodes a string to a UTF-8 byte array. More...
 
(int) + getByteCountWithInput:
 Gets the number of bytes that would be returned by a call to encode. More...
 
(FMLiveSwitchUtf8 *) + utf8
 

Detailed Description

UTF-8 encoding/decoding utility.

Method Documentation

◆ decodeWithBuffer:

+ (NSString*) decodeWithBuffer: (FMLiveSwitchDataBuffer *)  buffer

Decodes a UTF-8 data buffer to a string.

Parameters
bufferThe input byte array.

◆ decodeWithInput:

+ (NSString*) decodeWithInput: (NSMutableData *)  input

Decodes a UTF-8 byte array to a string.

Parameters
inputThe input byte array.

◆ decodeWithInput:index:length:

+ (NSString*) decodeWithInput: (NSMutableData *)  input
index: (int)  index
length: (int)  length 

Decodes a UTF-8 byte array to a string.

Parameters
inputThe input byte array.
indexThe index to start reading.
lengthThe length.

◆ encodeWithInput:

+ (NSMutableData*) encodeWithInput: (NSString *)  input

Encodes a string to a UTF-8 byte array.

Parameters
inputThe input string.

◆ getByteCountWithInput:

+ (int) getByteCountWithInput: (NSString *)  input

Gets the number of bytes that would be returned by a call to encode.

Parameters
inputThe input string.

◆ init

- (instancetype) init

◆ utf8

+ (FMLiveSwitchUtf8*) utf8