getU16Decoder function

FixedSizeDecoder<int> getU16Decoder([
  1. NumberCodecConfig? config
])

Creates a FixedSizeDecoder for unsigned 16-bit integers (u16).

Decodes 2 bytes as an int in the range 0, 65535. Defaults to little-endian byte order.

Implementation

FixedSizeDecoder<int> getU16Decoder([NumberCodecConfig? config]) =>
    numberDecoderFactory(
      name: 'u16',
      size: 2,
      get: (data, offset, endian) => data.getUint16(offset, endian),
      config: config,
    );