@Override
	public String getRepresentation(MemBuffer buf, Settings settings, int length) {

		int size = getLength();
		if (size <= 0) {
			size = length;
			if (size <= 0) {
				return "??";
			}
		}

		byte[] bytes = new byte[size];
		if (buf.getBytes(bytes, 0) != size) {
			return "??";
		}

		BigInteger value = DataConverter.getInstance(ENDIAN.isBigEndian(settings, buf))
				.getBigInteger(bytes, size, true);

		if (getFormatSettingsDefinition().getFormat(settings) == FormatSettingsDefinition.CHAR) {
			return StringDataInstance.getCharRepresentation(this, bytes, settings);
		}

		return getRepresentation(value, settings, 8 * length);
	}
Get the number of bits in the integral type

@param type the type
@return the number of bits
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractIntegerDataType.java