Re the recent posting by Daniel Gredler in the users
list: NonSeekableRandomAccessReadInputStream has length() 0 after start.
This is a problem if passed to TTFParser.parse() where it is fed to
a RandomAccessReadDataStream. There is a comment by me in one of the
tests which I added for better coverage, but I didn't do anything except
noticing it.
I don't have a good solution; throwing an exception for length breaks
the COSParser constructor, which is also used for page content streams.
What we could do is to document it it in javadoc not to use it outside
of PDFBox, and to catch it early in TTFParser because like Daniel,
people might use an autocomplete feature in their IDE and chose the
"wrong" class.
Somewhat related:
RandomAccessReadDataStream reads the entire input into a buffer. So this
means that if we pass the result of
RandomAccessReadBuffer.createBufferFromStream() to it, the buffering is
done twice, e.g. if PDTrueTypeFont.load(PDDocument doc, InputStream
input, Encoding encoding) is called.
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]