| #
23998838
|
| 16-Oct-2022 |
Damjan Jovanovic <damjan@apache.org> |
InputStreamToXInputStreamAdapter.readBytes() should read until the buffer is full, or the file ends. It shouldn't care about available().
Patch by: me
(cherry picked from commit f04910427d25ede98b8
InputStreamToXInputStreamAdapter.readBytes() should read until the buffer is full, or the file ends. It shouldn't care about available().
Patch by: me
(cherry picked from commit f04910427d25ede98b84b90df7cc5a12d1adc695)
show more ...
|
| #
9bca58a7
|
| 16-Oct-2022 |
Damjan Jovanovic <damjan@apache.org> |
Fix the java.lang.NullPointerException in readBytes() and readSomeBytes() methods in InputStreamToXInputStreamAdapter when called from the inter-process UNO bridge.
XInputStream::readBytes() documen
Fix the java.lang.NullPointerException in readBytes() and readSomeBytes() methods in InputStreamToXInputStreamAdapter when called from the inter-process UNO bridge.
XInputStream::readBytes() documents how the buffer is an "out" parameter, and isn't passed to the implementing end, which is why we get the buffer as a "byte[][] b" and b[0] == null. Its role is to box a byte[] array to be returned the client. Thus, allocate the buffer if it is missing or too small.
Additionally, virtually all other readBytes() and readSomeBytes() implementations trim this sequence to the actual number of bytes read. This presumably reduces the inter-process traffic, but some callers even rely on the sequence to be trimmed, eg. main/sax/source/expatwrap/xml2utf.cxx. Thus trim our returned array too.
Patch by: me
(cherry picked from commit 6cb06142790376a2c58e6392182eb071420a4221)
show more ...
|