public int length() throws InternalLogException, LogIncompatibleException
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "length");

        if (!_compatible)
        {
            if (tc.isEntryEnabled())
                Tr.exit(tc, "length", "LogIncompatibleException");
            throw new LogIncompatibleException();
        }

        if (_status == STATUS_INVALID)
        {
            if (tc.isEntryEnabled())
                Tr.exit(tc, "length", "LogHeaderInvalid - throwing InternalLogException");
            throw new InternalLogException(null);
        }

        // Calculate the length based on fixed and variable length data.
        // Include the 4 bytes that are used to store the header's length
        final int length = RLSUtils.INT_SIZE +
                           headerSize() +
                           _serverNameBytes.length +
                           _serviceNameBytes.length +
                           _logNameBytes.length +
                           (_variableFieldData != null ? _variableFieldData.length : 0) + // "VARFIELD" included in HEADER_SIZE even if _variableFieldData is null 
                           (_serviceData != null ? _serviceData.length : 0);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "length", new Integer(length));
        return length;
    }
public int length ( ) throws InternalLogException , LogIncompatibleException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "length" ) ; if ( ! _compatible ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "length" , "LogIncompatibleException" ) ; throw new LogIncompatibleException ( ) ; } if ( _status == STATUS_INVALID ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "length" , "LogHeaderInvalid - throwing InternalLogException" ) ; throw new InternalLogException ( null ) ; } final int length = RLSUtils . INT_SIZE + headerSize ( ) + _serverNameBytes . length + _serviceNameBytes . length + _logNameBytes . length + ( _variableFieldData != null ? _variableFieldData . length : 0 ) + ( _serviceData != null ? _serviceData . length : 0 ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "length" , new Integer ( length ) ) ; return length ; }
<p>
Calculate the length in byte of this header. This method may be used by the
log file handle to determine the size of the header when writing all pending
records during a force.
</p>

@exception LogIncompatibleException The target object represents an incompatible
header.
@exception InternalLogException The target object represents an invalid header.