valueSetterForEndian static method

ValueSetter valueSetterForEndian(
  1. ByteSetter bytes,
  2. int endian
)

Get the appropriate ValueGetter for my endianness

@param bytes The ByteSetter to use @param endian the endian for the ValueSetter to use @return the ValueGetter

Implementation

static ValueSetter valueSetterForEndian(ByteSetter bytes, int endian) {
  if (endian == XDRSetter.NUMBER) {
    // XDR
    return XDRSetter(bytes);
  } else if (endian == NDRSetter.NUMBER) {
    return NDRSetter(bytes);
  } else {
    throw ArgumentError("Unknown Endian type: $endian");
  }
}