final synchronized public Number getNumber(final int index) throws Exception, IndexOutOfBoundsException
    {
        switch (type)
        {
        case BOOL:
        case SINT:
            return new Byte(data.get(type.element_size * index));
        case INT:
            return new Short(data.getShort(type.element_size * index));
        case DINT:
        case BITS:
            return new Integer(data.getInt(type.element_size * index));
        case REAL:
            return new Float(data.getFloat(type.element_size * index));
        default:
            throw new Exception("Cannot retrieve Number from " + type);
        }
    }