tatsiana mays created PDFBOX-1300:
-------------------------------------
Summary: COSNumber cannot convert numbers to long
Key: PDFBOX-1300
URL: https://issues.apache.org/jira/browse/PDFBOX-1300
Project: PDFBox
Issue Type: Bug
Components: Parsing
Reporter: tatsiana mays
in COSNumber.java if number passed is greater then long
9,223,372,036,854,775,807. This is what i have
2514740409086472832680141218906112. The method below cannot hadle
Need to do some extra else if loop
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(digit - '0');
} else if (digit == '-' || digit == '.') {
// See https://issues.apache.org/jira/browse/PDFBOX-592
return COSInteger.ZERO;
} else {
throw new IOException("Not a number: " + number);
}
} else if (number.indexOf('.') == -1 && number.length() < 19) {
try
{
return COSInteger.get( Long.parseLong( number ) );
}
catch( NumberFormatException e )
{
throw new IOException( "Value is not an integer: " + number );
}
} else {
return new COSFloat(number);
}
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira