# FlutterStandardReader

Objective-C

    @interface FlutterStandardReader : NSObject

Swift

    class FlutterStandardReader : NSObject

A reader of the Flutter standard binary encoding.

See `FlutterStandardMessageCodec` for details on the encoding.

The encoding is extensible via subclasses overriding `readValueOfType`.

- `-initWithData:`

  Create a new `FlutterStandardReader` who reads from \p data.

  #### Declaration

  Objective-C

      - (nonnull instancetype)initWithData:(nonnull NSData *)data;

  Swift

      init(data: Data)

- `-hasMore`

  Returns YES when the reader hasn’t reached the end of its data.

  #### Declaration

  Objective-C

      - (BOOL)hasMore;

  Swift

      func hasMore() -> Bool

- `-readByte`

  Reads a byte value and increments the position.

  #### Declaration

  Objective-C

      - (UInt8)readByte;

  Swift

      func readByte() -> UInt8

- `-readBytes:length:`

  Reads a sequence of byte values of \p length and increments the position.

  #### Declaration

  Objective-C

      - (void)readBytes:(nonnull void *)destination length:(NSUInteger)length;

  Swift

      func readBytes(_ destination: UnsafeMutableRawPointer, length: UInt)

- `-readData:`

  Reads a sequence of byte values of \p length and increments the position.

  #### Declaration

  Objective-C

      - (nonnull NSData *)readData:(NSUInteger)length;

  Swift

      func readData(_ length: UInt) -> Data

- `-readSize`

  Reads a 32-bit unsigned integer representing a collection size and increments the position.

  #### Declaration

  Objective-C

      - (UInt32)readSize;

  Swift

      func readSize() -> UInt32

- `-readAlignment:`

  Advances the read position until it is aligned with \p alignment.

  #### Declaration

  Objective-C

      - (void)readAlignment:(UInt8)alignment;

  Swift

      func readAlignment(_ alignment: UInt8)

- `-readUTF8`

  Read a null terminated string encoded with UTF-8/

  #### Declaration

  Objective-C

      - (nonnull NSString *)readUTF8;

  Swift

      func readUTF8() -> String

- `-readValue`

  Reads a byte for `FlutterStandardField` the decodes a value matching that type.

  See also: -[FlutterStandardWriter writeValue]

  #### Declaration

  Objective-C

      - (nullable id)readValue;

  Swift

      func readValue() -> Any?

- `-readValueOfType:`

  Decodes a value matching the \p type specified.

  See also:

  - `FlutterStandardField`
  - `-[FlutterStandardWriter writeValue]`

  #### Declaration

  Objective-C

      - (nullable id)readValueOfType:(UInt8)type;

  Swift

      func readValue(ofType type: UInt8) -> Any?

© 2023 Flutter. All rights reserved. (Last updated: 2023-05-16)

Generated by jazzy ♪♫ v0.14.3, a Realm project.