filmov
tv
I boosted the PushbackInputStream | OpenJDK Contrib | Java Coding | Head Crashing Informatics 66

Показать описание
As #PushbackInputStream is quite similar to #BufferedInputStream, it was rather easy for me to apply the performance optimizations I already developed for BufferedInputStream to the PushbackInputStream. The contribution was accepted in November 2022, so it is now part of #OpenJDK (aka #Java) 20.
The change will make your application #transferTo bytes faster in case your source or target is a file stream and you wrapped it using a PushbackInputStream. For example, if you read the magic byte of a file to find out about the file type, then push it back and transferTo() the complete content to a specific image processing algorithm, the bytes will not walk through the in-memory buffer anymore, sparing processing time.
If you missed the original contribution last year, check my channel page, it is covered by a four-parts series!
The change will make your application #transferTo bytes faster in case your source or target is a file stream and you wrapped it using a PushbackInputStream. For example, if you read the magic byte of a file to find out about the file type, then push it back and transferTo() the complete content to a specific image processing algorithm, the bytes will not walk through the in-memory buffer anymore, sparing processing time.
If you missed the original contribution last year, check my channel page, it is covered by a four-parts series!