@ SuppressWarnings ( "checkstyle:magicnumber" ) private static int readDateRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Date > value ) throws IOException { final GregorianCalendar cal = new GregorianCalendar ( ) ; final int year = ( ( rawData [ rawOffset ] & 0xFF ) - ' ' ) * 1000 + ( ( rawData [ rawOffset + 1 ] & 0xFF ) - ' ' ) * 100 + ( ( rawData [ rawOffset + 2 ] & 0xFF ) - ' ' ) * 10 + ( ( rawData [ rawOffset + 3 ] & 0xFF ) - ' ' ) ; final int month = ( ( rawData [ rawOffset + 4 ] & 0xFF ) - ' ' ) * 10 + ( ( rawData [ rawOffset + 5 ] & 0xFF ) - ' ' ) ; final int day = ( ( rawData [ rawOffset + 6 ] & 0xFF ) - ' ' ) * 10 + ( ( rawData [ rawOffset + 7 ] & 0xFF ) - ' ' ) ; cal . set ( Calendar . YEAR , year ) ; cal . set ( Calendar . MONTH , month ) ; cal . set ( Calendar . DAY_OF_MONTH , day ) ; if ( year == cal . get ( Calendar . YEAR ) && month == cal . get ( Calendar . MONTH ) && day == cal . get ( Calendar . DAY_OF_MONTH ) ) { value . set ( cal . getTime ( ) ) ; return 8 ; } throw new InvalidRawDataFormatException ( nrecord , nfield , new String ( rawData , rawOffset , field . getLength ( ) ) ) ; }
Read a DATE record value .