public static ChecksumType codeToType(final byte b) {
    for (ChecksumType t : ChecksumType.values()) {
      if (t.getCode() == b) {
        return t;
      }
    }
    throw new RuntimeException("Unknown checksum type code " + b);
  }
Cannot rely on enum ordinals . They change if item is removed or moved. Do our own codes.
@return Type associated with passed code.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java