FlutterStandardWriter

@interface FlutterStandardWriter : NSObject

A writer of the Flutter standard binary encoding.

See FlutterStandardMessageCodec for details on the encoding.

The encoding is extensible via subclasses overriding writeValue.

  • Create a FlutterStandardWriter who will write to \p data.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithData:(nonnull NSMutableData *)data;
  • Write a 8-bit byte.

    Declaration

    Objective-C

    - (void)writeByte:(UInt8)value;
  • Write an array of \p bytes of size \p length.

    Declaration

    Objective-C

    - (void)writeBytes:(nonnull const void *)bytes length:(NSUInteger)length;
  • Write an array of bytes contained in \p data.

    Declaration

    Objective-C

    - (void)writeData:(nonnull NSData *)data;
  • Write 32-bit unsigned integer that represents a \p size of a collection.

    Declaration

    Objective-C

    - (void)writeSize:(UInt32)size;
  • Write zero padding until data is aligned with \p alignment.

    Declaration

    Objective-C

    - (void)writeAlignment:(UInt8)alignment;
  • Write a string with UTF-8 encoding.

    Declaration

    Objective-C

    - (void)writeUTF8:(nonnull NSString *)value;
  • Introspects into an object and writes its representation. *

    • Supported Data Types:
    • - NSNull
    • - NSNumber
    • - NSString (as UTF-8)
    • - FlutterStandardTypedData
    • - NSArray of supported types
    • - NSDictionary of supporte types *
    • NSAsserts on failure.

    Declaration

    Objective-C

    - (void)writeValue:(nonnull id)value;