/* Swap integer bytes. */ private int Swap(int value) { byte[] inBytes = IntUtils.ToBytes(value); return(IntUtils.BytesToInteger( new byte[4] { inBytes[3], inBytes[2], inBytes[1], inBytes[0] })); /*return ((value & 0x000000ff) << 24) | * ((value & 0x0000ff00) << 8) | * ((value & 0x00ff0000) >> 8) | * ((value & 0xff000000) >> 24);*/ }
public int GetInt() { byte[] buffer = new byte[4]; _ms.Read(buffer, 0, buffer.Length); return(IntUtils.BytesToInteger(buffer)); }