private static int PadSize(int rawSize) { int pad = rawSize % 4; if (pad == 0) return rawSize; else return rawSize + (4 - pad); } }