private void processWorkWeeks ( byte [ ] data , int offset , ProjectCalendar cal ) { // System.out.println("Calendar=" + cal.getName()); // System.out.println("Work week block start offset=" + offset); // System.out.println(ByteArrayHelper.hexdump(data, true, 16, "")); // skip 4 byte header offset += 4 ; while ( data . length >= offset + ( ( 7 * 60 ) + 2 + 2 + 8 + 4 ) ) { //System.out.println("Week start offset=" + offset); ProjectCalendarWeek week = cal . addWorkWeek ( ) ; for ( Day day : Day . values ( ) ) { // 60 byte block per day processWorkWeekDay ( data , offset , week , day ) ; offset += 60 ; } Date startDate = DateHelper . getDayStartDate ( MPPUtility . getDate ( data , offset ) ) ; offset += 2 ; Date finishDate = DateHelper . getDayEndDate ( MPPUtility . getDate ( data , offset ) ) ; offset += 2 ; // skip unknown 8 bytes //System.out.println(ByteArrayHelper.hexdump(data, offset, 8, false)); offset += 8 ; // // Extract the name length - ensure that it is aligned to a 4 byte boundary // int nameLength = MPPUtility . getInt ( data , offset ) ; if ( nameLength % 4 != 0 ) { nameLength = ( ( nameLength / 4 ) + 1 ) * 4 ; } offset += 4 ; if ( nameLength != 0 ) { String name = MPPUtility . getUnicodeString ( data , offset , nameLength ) ; offset += nameLength ; week . setName ( name ) ; } week . setDateRange ( new DateRange ( startDate , finishDate ) ) ; // System.out.println(week); } }
Read the work weeks .