public static COSNumber get( String number ) throws IOException
    {
        if (number.length() == 1)
        {
            char digit = number.charAt(0);
            if ('0' <= digit && digit <= '9') 
            {
                return COSInteger.get((long) digit - '0');
            } 
            if (digit == '-' || digit == '.')
            {
                // See https://issues.apache.org/jira/browse/PDFBOX-592
                return COSInteger.ZERO;
            } 
            throw new IOException("Not a number: " + number);
        } 
        if (isFloat(number))
        {
            return new COSFloat(number);
        }
        try
        {
            return COSInteger.get(Long.parseLong(number));
        }
        catch (NumberFormatException e)
        {
            // check if the given string could be a number at all
            String numberString = number.startsWith("+") || number.startsWith("-")
                    ? number.substring(1) : number;
            if (!numberString.matches("[0-9]*"))
            {
                throw new IOException("Not a number: " + number);
            }
            // return a limited COSInteger value which is marked as invalid
            return number.startsWith("-") ? COSInteger.OUT_OF_RANGE_MIN
                    : COSInteger.OUT_OF_RANGE_MAX;
        }
    }
@Test
    void testInvalidNumber()
    {
        try
        {
            COSNumber.get("18446744073307F448448");
            fail("Was expecting an IOException");
        }
        catch (IOException e)
        {
        }
    }