It happens in RandomAccessReadBuffer(InputStream input) .

input.available() returns 0 despite that more bytes are available. This can be shown with this change:


            if (remainingBytes == 0 && input.available() > 0)
            {
                expandBuffer();
            }
            else
            {
////////////////////// new
                int by = input.read();
                if (by != -1)
                {
                    throw new IOException("hey there was more");
                }
///////////////////// end of new code
currentBuffer.limit(offset);
                break;
            }

also, this test code

    @Test
    void testBlah() throws IOException
    {
        System.out.println("start");
        try (InputStream is = new URL("https://issues.apache.org/jira/secure/attachment/13017227/stringwidth.pdf";).openStream())
        {
            RandomAccessReadBuffer rarb = new RandomAccessReadBuffer(is);
            System.out.println(rarb.length());
        }
    }

shows 8192 bytes. The real size of the file is 34KB.


Tilman

Am 25.02.2021 um 20:26 schrieb Tilman Hausherr:
Something is weird with the trunk build. It fails on my PC and on Jenkins despite no changes.

An example is PDFontTest.testPDFox5048(). That one fails as it is, but doesn't fail when using a local file.

Also, the URL

https://issues.apache.org/jira/secure/attachment/13017227/stringwidth.pdf

has a FontFile3 = null when loaded with CTRL-U in PDFDebugger, but not when loaded locally.

Same test works fine when done in the 2.0 build

Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to