readEnum<E extends Enum> method

E readEnum<E extends Enum>(
  1. List<E> enumValues
)

Reads an enum index, and returns a value from enumValues. Increments position by 1.

Implementation

E readEnum<E extends Enum>(List<E> enumValues) {
  var idx = readByte();
  return enumValues[idx];
}