private CodeAttributeInfo convertToCode(ByteBuffer byteBuffer,
			Map<Integer, ConstantPool> cpMap, int attributeNameIndex,
			int attributeLength) throws ClassFileFormatException {
		CodeAttributeInfo cai = new CodeAttributeInfo();
		cai.setAttributeNameIndex(attributeNameIndex);
		cai.setAttributeLength(attributeLength);
		cai.setMaxStack(byteBuffer.getShort()); // max_stack(2byte)
		logger.debug("\t\t\tMaxStack : " + cai.getMaxStack());
		cai.setMaxLocals(byteBuffer.getShort()); // max_locals(2byte)
		logger.debug("\t\t\tMaxLocals : " + cai.getMaxStack());
		cai.setCodeLength(byteBuffer.getInt()); // code_length(4byte)
		logger.debug("\t\t\tCodeLength : " + cai.getMaxStack());
		cai.setOpcodes(opcodeLogic.convertToOpcodeList(byteBuffer,cai.getCodeLength()));
		cai.setExceptionTableLength(byteBuffer.getShort()); // exception_table_length(2byte)
		if (cai.getExceptionTableLength() > 0) {
			ExceptionTableInfo[] etis = new ExceptionTableInfo[cai
					.getExceptionTableLength()];
			int i = 0;
			while (i < cai.getExceptionTableLength()) {
				etis[i] = convertToExceptionTableInfo(byteBuffer);
				i++;
			}
		}

		cai.setAttributesCount(byteBuffer.getShort()); // attribute_count(2byte)
		if (cai.getAttributesCount() > 0) {
			Attribute[] attributes = new Attribute[cai.getAttributesCount()];
			int i = 0;
			while (i < cai.getAttributesCount()) {
				attributes[i] = convertToAttribute(byteBuffer, cpMap);
				i++;
			}
		}
		return cai;
	}