1 package org.eclipse.jdt.internal.core.nd.db;
2 
3 public class LargeBlock {
4 	public static final int SIZE_OFFSET = 0;
5 	public static final int SIZE_OF_SIZE_FIELD = Database.INT_SIZE;
6 	/**
7 	 * Size of the header for a large block. The header consists of a int which holds the number of chunks in the block.
8 	 * It is negative for an allocated block and positive for an unallocated block. The header is located at the start
9 	 * of the large block.
10 	 */
11 	public static final int HEADER_SIZE = Math.max(Database.INT_SIZE, Database.BLOCK_SIZE_DELTA);
12 
13 	public static final int ENTRIES_IN_CHILD_TABLE = SIZE_OF_SIZE_FIELD * 8;
14 	public static final int CHILD_TABLE_OFFSET = HEADER_SIZE;
15 	public static final int PARENT_OFFSET = CHILD_TABLE_OFFSET + (Database.INT_SIZE * ENTRIES_IN_CHILD_TABLE);
16 	public static final int PREV_BLOCK_OFFSET = PARENT_OFFSET + Database.INT_SIZE;
17 	public static final int NEXT_BLOCK_OFFSET = PREV_BLOCK_OFFSET + Database.INT_SIZE;
18 
19 	public static final int UNALLOCATED_HEADER_SIZE = NEXT_BLOCK_OFFSET + Database.INT_SIZE;
20 
21 	/**
22 	 * The large block footer is located at the end of the last chunk in the large block. It is an exact copy of the
23 	 * header.
24 	 */
25 	public static final int FOOTER_SIZE = HEADER_SIZE;
26 }
27