public static RSInterface readHeaderChunk(JagexBuffer buffer) {
		try {
			int parentId = -1;
			int interfaceId = buffer.getUnsignedShort();
			if (interfaceId == 65535) {
				parentId = buffer.getUnsignedShort();
				interfaceId = buffer.getUnsignedShort();
			}
			RSInterface rsi = new RSInterface();
			RSInterface.cache.put(interfaceId, rsi);
			rsi.id = interfaceId;
			rsi.parentId = parentId;
			rsi.type = buffer.getUnsignedByte();
			rsi.actionType = buffer.getUnsignedByte();
			rsi.contentType = buffer.getUnsignedShort();
			rsi.width = buffer.getUnsignedShort();
			rsi.height = buffer.getUnsignedShort();
			rsi.alpha = (byte) buffer.getUnsignedByte();
			rsi.hoverId = buffer.getUnsignedByte();
			if (rsi.hoverId != 0) {
				rsi.hoverId = (rsi.hoverId - 1 << 8) + buffer.getUnsignedByte();
			} else {
				rsi.hoverId = -1;
			}
			int requiredmentIndex = buffer.getUnsignedByte();
			if (requiredmentIndex > 0) {
				rsi.valueCompareType = new int[requiredmentIndex];
				rsi.requiredValues = new int[requiredmentIndex];
				for (int index = 0; index < requiredmentIndex; index++) {
					rsi.valueCompareType[index] = buffer.getUnsignedByte();
					rsi.requiredValues[index] = buffer.getUnsignedShort();
				}
			}
			int valueType = buffer.getUnsignedByte();
			if (valueType > 0) {
				rsi.valueIndexArray = new int[valueType][];
				for (int valueIndex = 0; valueIndex < valueType; valueIndex++) {
					int size = buffer.getUnsignedShort();
					rsi.valueIndexArray[valueIndex] = new int[size];
					for (int nextIndex = 0; nextIndex < size; nextIndex++) {
						rsi.valueIndexArray[valueIndex][nextIndex] = buffer.getUnsignedShort();
					}
				}
			}
			return rsi;
		} catch (Exception e) {
			System.out.println("[Interface] An error occurred while reading the header chunk.");
			e.printStackTrace();
		}
		return null;
	}