// assume byteArray[] is the array with code. // We know that we're going to increase by 16 bits, so we just do that and move through the array for(int i = 0; i < byteArray.Length; i+= 16) { Brg565 pixel; pixel.PackedValue = 0; for(int packedBit = 0; packedBit < 16; packedBit++) { pixel.PackedValue += byteArray[i + packedBit] << (15 - packedBit); } // do whatever with the Brg656 }