read static method

Implementation

static LiftRetVal<EncodeException> read(Uint8List buf) {
  final index = buf.buffer.asByteData(buf.offsetInBytes).getInt32(0);
  final subview = Uint8List.view(buf.buffer, buf.offsetInBytes + 4);
  switch (index) {
    case 1:
      return IoEncodeException.read(subview);
    case 2:
      return OversizedVectorAllocationEncodeException.read(subview);
    case 3:
      return InvalidChecksumEncodeException.read(subview);
    case 4:
      return NonMinimalVarIntEncodeException.read(subview);
    case 5:
      return ParseFailedEncodeException.read(subview);
    case 6:
      return UnsupportedSegwitFlagEncodeException.read(subview);
    case 7:
      return OtherEncodeErrEncodeException.read(subview);
    default:
      throw UniffiInternalError(UniffiInternalError.unexpectedEnumCase,
          "Unable to determine enum variant");
  }
}