valueOf static method

Multicodec valueOf(
  1. int code
)

Returns the specific codec based on code.

Implementation

static Multicodec valueOf(final int code) {
  for (final codec in values) {
    if (codec.code == code) {
      return codec;
    }
  }

  throw UnsupportedError('Unsupported code: [$code]');
}