private void VerifyDataLength(int actualLength, int expectedLength, string errorMessage) { if (actualLength != expectedLength) { throw new FormatException(errorMessage); } }