getInt32 static method

int getInt32(
  1. List<int> buf,
  2. Endian byteOrder
)

Implementation

static int getInt32(List<int> buf, Endian byteOrder) {
  if (byteOrder == Endian.big) {
    return ((buf[0] & 0xff) << 24) |
        ((buf[1] & 0xff) << 16) |
        ((buf[2] & 0xff) << 8) |
        ((buf[3] & 0xff));
  } else {
    // LITTLE_ENDIAN
    return ((buf[3] & 0xff) << 24) |
        ((buf[2] & 0xff) << 16) |
        ((buf[1] & 0xff) << 8) |
        ((buf[0] & 0xff));
  }
}