Read sync safe int 32
//http://walkmen.codeplex.com/license // License: GNU General Public License version 2 (GPLv2) using System; using System.Collections.Generic; using System.Text; namespace Walkmen.Util { public sealed class NumericUtils { private NumericUtils() { } public static int ReadSynchsafeInt32(byte[] buffer, int offset) { return ((buffer[offset + 0] & 0x7F) << 21) | ((buffer[offset + 1] & 0x7F) << 14) | ((buffer[offset + 2] & 0x7F) << 7) | (buffer[offset + 3] & 0x7f); } } }