putInt32 static method

void putInt32(
  1. int intValue,
  2. List<int> buf,
  3. Endian byteOrder
)

Implementation

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