Flutter Engine
FlutterStandardTypedData Class Reference

#import <FlutterCodecs.h>

Inheritance diagram for FlutterStandardTypedData:

Class Methods

(instancetype) + typedDataWithBytes:
 
(instancetype) + typedDataWithInt32:
 
(instancetype) + typedDataWithInt64:
 
(instancetype) + typedDataWithFloat64:
 

Properties

NSData * data
 
FlutterStandardDataType type
 
UInt32 elementCount
 
UInt8 elementSize
 

Detailed Description

A byte buffer holding UInt8, SInt32, SInt64, or Float64 values, used with FlutterStandardMessageCodec and FlutterStandardMethodCodec.

Two's complement encoding is used for signed integers. IEEE754 double-precision representation is used for floats. The platform's native endianness is assumed.

Definition at line 297 of file FlutterCodecs.h.

Method Documentation

◆ typedDataWithBytes:()

+ (instancetype) typedDataWithBytes: (NSData*)  data

Creates a FlutterStandardTypedData which interprets the specified data as plain bytes.

Parameters
datathe byte data.

Definition at line 153 of file FlutterStandardCodec.mm.

Referenced by FlutterStandardWriter::writeValue:.

153  :(NSData*)data {
154  return [FlutterStandardTypedData typedDataWithData:data type:FlutterStandardDataTypeUInt8];
155 }

◆ typedDataWithFloat64:()

+ (instancetype) typedDataWithFloat64: (NSData*)  data

Creates a FlutterStandardTypedData which interprets the specified data as 64-bit floats.

Parameters
datathe byte data. The length must be divisible by 8.

Definition at line 165 of file FlutterStandardCodec.mm.

References data, elementCount, elementSize, flutter::elementSizeForFlutterStandardDataType(), and type.

165  :(NSData*)data {
166  return [FlutterStandardTypedData typedDataWithData:data type:FlutterStandardDataTypeFloat64];
167 }

◆ typedDataWithInt32:()

+ (instancetype) typedDataWithInt32: (NSData*)  data

Creates a FlutterStandardTypedData which interprets the specified data as 32-bit signed integers.

Parameters
datathe byte data. The length must be divisible by 4.

Definition at line 157 of file FlutterStandardCodec.mm.

157  :(NSData*)data {
158  return [FlutterStandardTypedData typedDataWithData:data type:FlutterStandardDataTypeInt32];
159 }

◆ typedDataWithInt64:()

+ (instancetype) typedDataWithInt64: (NSData*)  data

Creates a FlutterStandardTypedData which interprets the specified data as 64-bit signed integers.

Parameters
datathe byte data. The length must be divisible by 8.

Definition at line 161 of file FlutterStandardCodec.mm.

161  :(NSData*)data {
162  return [FlutterStandardTypedData typedDataWithData:data type:FlutterStandardDataTypeInt64];
163 }

Property Documentation

◆ data

- (NSData*) data
readnonatomicassign

The raw underlying data buffer.

Definition at line 333 of file FlutterCodecs.h.

Referenced by flutter::FlutterPlatformViewsController::OnMethodCall, and typedDataWithFloat64:.

◆ elementCount

- (UInt32) elementCount
readnonatomicassign

The number of value items encoded.

Definition at line 343 of file FlutterCodecs.h.

Referenced by typedDataWithFloat64:.

◆ elementSize

- (UInt8) elementSize
readnonatomicassign

The number of bytes used by the encoding of a single value item.

Definition at line 348 of file FlutterCodecs.h.

Referenced by typedDataWithFloat64:.

◆ type

- (FlutterStandardDataType) type
readnonatomicassign

The type of the encoded values.

Definition at line 338 of file FlutterCodecs.h.

Referenced by typedDataWithFloat64:.


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