public static int DecodeInt32(byte[] buffer, ref int offset) { var value = Bits.ToInt32(buffer, offset); offset += 4; return value; }