private int checkIndex(final ByteBuffer buf) {
		
		try {
			outputLog("Type = " + new String(buf.array(), 0, 4, "ASCII"));
			outputLog("Version = " + buf.getShort(0x18) + "." + buf.getShort(0x1A));
			outputLog("ID = 0x" + Long.toHexString(buf.getLong(0x1C)));
			
			int offset = buf.getInt(0x5C) + 0x60;
			if(buf.limit() > offset) {
				
				outputLog("Info Offset = 0x" + Integer.toHexString(offset));
				outputLog("Info Type = 0x" + Integer.toHexString(buf.getInt(offset)));
				outputLog("Info Size = 0x" + Integer.toHexString((buf.getInt(offset + 4) + offset + 12)));
				
				if (buf.getInt(offset) != 3 && buf.limit() > (offset - 0x1C)) {
					offset = (buf.getInt(offset + 4) + offset + 12);
				}
				else if(buf.getInt(offset) != 3) {
					outputLog("The file is not a LD2 local file.");
					return -1;
				}
				
				outputLog("Dictionary Type = 0x" + Integer.toHexString(buf.getInt(offset)));
				
				lengthCompressedData = buf.getInt(offset + 4) + offset + 8;			
				lengthIndex = buf.getInt(offset + 8) + offsetIndex;
				offsetInflatedWords = buf.getInt(offset + 12);
				lengthInflatedWords = buf.getInt(offset + 16);
				lengthInflatedXml = buf.getInt(offset + 20);
				offsetIndex = offset + 0x1C;
				offsetInflatedXml = offsetInflatedWords + lengthInflatedWords;
				
				final int countDefinitions = (lengthIndex) / 4;	
	
				buf.position(offsetIndex + lengthIndex + 8 + 4);
				int idx = 0;
				int tmp = 0;
				do {
					offset = buf.getInt();
					BlockData data = new BlockData();					
					data.index = idx ++;
					data.length = offset - tmp;					
					listBlockData.add(data);
					tmp = offset;
					
				} while((offset + buf.position()) < lengthCompressedData); 
				
				offsetCompressedData = buf.position();
				
				outputLog("Index Offset = 0x" + Integer.toHexString(offsetIndex));
				outputLog("Index Length = 0x" + Integer.toHexString(lengthIndex));
				outputLog("Compressed Data Offset = 0x" + Integer.toHexString(offsetCompressedData));
				outputLog("Compressed Data Length = 0x" + Integer.toHexString(lengthCompressedData));
				outputLog("Inflated Words Offset = 0x" + Integer.toHexString(offsetInflatedWords));
				outputLog("Inflated Word Length = 0x" + Integer.toHexString(lengthInflatedWords));
				outputLog("Inflated Xml Offset = 0x" + Integer.toHexString(offsetInflatedXml));
				outputLog("Inflated Xml Length = 0x" + Integer.toHexString(lengthInflatedXml));
				outputLog("Quantity of Compressed Data Block = 0x" + Integer.toHexString(listBlockData.size()) + "(" + listBlockData.size() + ")");			
				outputLog("Quantity of Definitions = 0x" + Integer.toHexString(countDefinitions) + "(" + countDefinitions + ")");

			}
			else {
				outputLog("The file is not a LD2 file.");
				return -1;
			}		
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			return -1;
		}		
		
		for(final BlockData data : listBlockData) {
			outputLog(data.toString());
		}		
		
		return 0;
	}