Bug 191637 Empty cube causes error
Comment removed as requested by the submitter - 2007-06-08 droy
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/util/DiskIndex.java
private IDiskArray writeNonLeafNode( IDiskArray sortedKeyArray,
			IDiskArray startOffset, int level, int sonLevelTotalNumber )
			throws IOException, DataException
	{
		int interval = pow( degree, level );
		BufferedPrimitiveDiskArray sonStartOffset = new BufferedPrimitiveDiskArray( Math.min( Constants.LIST_BUFFER_SIZE,
				startOffset.size( ) / degree + 1 ) );
		for ( int i = 0; i < startOffset.size( ); i++ )
		{
			if ( i % degree == 0 )
			{
				sonStartOffset.add( new Integer( (int) documentObject.getFilePointer( ) ) );
			}
			if ( i != startOffset.size( ) - 1 )
			{
				documentObject.writeByte( degree );
				
				DocumentObjectUtil.writeValue( documentObject,
							keyDataType,
							( (IndexKey) sortedKeyArray.get( i * interval ) ).getKey() );
				
				DocumentObjectUtil.writeValue( documentObject,
							keyDataType,
							( (IndexKey) sortedKeyArray.get( ( i + 1 )
									* interval - 1 ) ).getKey() );
			}
			else
			{
				documentObject.writeByte( sonLevelTotalNumber
						- ( startOffset.size( ) - 1 ) * degree );