5 #ifndef FLUTTER_FLUTTERCODECS_H_
6 #define FLUTTER_FLUTTERCODECS_H_
8 #import <Foundation/Foundation.h>
30 - (NSData* _Nullable)encode:(
id _Nullable)message;
38 - (
id _Nullable)decode:(NSData* _Nullable)message;
96 - (instancetype)initWithData:(NSMutableData*)data;
98 - (void)writeByte:(UInt8)value;
100 - (void)writeBytes:(const
void*)bytes length:(NSUInteger)length;
102 - (void)writeData:(NSData*)data;
104 - (void)writeSize:(UInt32)size;
106 - (void)writeAlignment:(UInt8)alignment;
108 - (void)writeUTF8:(NSString*)value;
121 - (void)writeValue:(
id)value;
136 - (instancetype)initWithData:(NSData*)data;
142 - (void)readBytes:(
void*)destination length:(NSUInteger)length;
144 - (NSData*)readData:(NSUInteger)length;
148 - (void)readAlignment:(UInt8)alignment;
164 - (nullable id)readValueOfType:(UInt8)type;
228 + (instancetype)methodCallWithMethodName:(NSString*)method arguments:(
id _Nullable)arguments;
233 @property(readonly, nonatomic) NSString*
method;
254 + (instancetype)errorWithCode:(NSString*)code
255 message:(NSString* _Nullable)message
256 details:(
id _Nullable)details;
260 @property(readonly, nonatomic) NSString*
code;
265 @property(readonly, nonatomic, nullable) NSString*
message;
270 @property(readonly, nonatomic, nullable)
id details;
281 typedef NS_ENUM(NSInteger, FlutterStandardDataType) {
282 FlutterStandardDataTypeUInt8,
283 FlutterStandardDataTypeInt32,
284 FlutterStandardDataTypeInt64,
285 FlutterStandardDataTypeFloat32,
286 FlutterStandardDataTypeFloat64,
305 + (instancetype)typedDataWithBytes:(NSData*)data;
313 + (instancetype)typedDataWithInt32:(NSData*)data;
321 + (instancetype)typedDataWithInt64:(NSData*)data;
329 + (instancetype)typedDataWithFloat32:(NSData*)data;
337 + (instancetype)typedDataWithFloat64:(NSData*)data;
342 @property(readonly, nonatomic) NSData*
data;
347 @property(readonly, nonatomic, assign) FlutterStandardDataType
type;
366 "FlutterStandardBigInteger was needed because the Dart 1.0 int type had no "
367 "size limit. With Dart 2.0, the int type is a fixed-size, 64-bit signed "
368 "integer. If you need to communicate larger integers, use NSString encoding "
370 @interface FlutterStandardBigInteger : NSObject
389 @protocol FlutterMethodCodec
420 - (NSData*)encodeSuccessEnvelope:(
id _Nullable)result;
438 - (
id _Nullable)decodeEnvelope:(NSData*)envelope;
476 #endif // FLUTTER_FLUTTERCODECS_H_