int (int lengthToPad, boolean commited) { if (lengthToPad == 0) { throw new IllegalArgumentException("lengthToPad(=" + lengthToPad + ") must be >0"); } int totalRecordSize = lengthToPad; if ((totalRecordSize & (~RECORD_LENGTH_MASK)) != 0) { throw new IllegalArgumentException("lengthToPad(=" + lengthToPad + ") must have 2 highest bits 0"); } return totalRecordSize | RECORD_TYPE_MASK | (commited ? 0 : COMMITED_STATUS_MASK); }