int (int payloadLength, boolean commited) { int totalRecordSize = payloadLength + RECORD_HEADER_SIZE; if ((totalRecordSize & COMMITED_STATUS_MASK) != 0 || (totalRecordSize & RECORD_TYPE_MASK) != 0) { throw new IllegalArgumentException("totalRecordSize(=" + totalRecordSize + ") must have 2 highest bits 0"); } return totalRecordSize | (commited ? COMMITED_STATUS_OK : COMMITED_STATUS_NOT_YET); }