Re: RFR: JDK-8348030 : Extend Math.min and Math.max to support multiple parameters [v2]

2025-01-20 Thread Martin Desruisseaux
On Mon, 20 Jan 2025 11:43:13 GMT, Aviad Zer wrote: >> This change extends the Math.min function to support multiple parameters, >> improving its usability and code readability. >> >> Previously, finding the minimum value among multiple variables required >> using nested Math.min calls or conve

Re: Read-only view of ByteArrayInputStream content

2024-07-10 Thread Martin Desruisseaux
Le 2024-07-10 à 18 h 00, Archie Cobbs a écrit : So would you accept a solution to this problem in the java.sql package instead? For example by adding two new methods: java.sql.Blob.asByteBuffer() java.sql.Clob.asCharBuffer() Yes, it would work for me if JDBC drivers provide their own imple

Re: Read-only view of ByteArrayInputStream content

2024-07-09 Thread Martin Desruisseaux
Le 2024-07-09 à 20 h 14, Archie Cobbs a écrit : Gotcha - so in other words, you want a way to effectively "unwrap" the original byte[] array so you can access the whole thing at one time (random access), as opposed to just accessing it in online fashion as a stream of bytes. Indeed, I wanted

Re: Read-only view of ByteArrayInputStream content

2024-07-09 Thread Martin Desruisseaux
Hello Archie, thanks for the reply. Le 2024-07-09 à 18 h 17, Archie Cobbs a écrit : The difference in the old vs. new behavior is the use of a 128k temporary transfer buffer. So if I understand this correctly the performance problem you are addressing (in terms of blown cache) is not proporti

Read-only view of ByteArrayInputStream content

2024-07-09 Thread Martin Desruisseaux
Hello JDK-22 has modified ByteArrayInputStream.transferTo(OutputStream) implementation for performing a defensive copy of the byte array when the destination is not trusted (JDK-8321053). However, I was using the previous implementation as a trick for reading the array without copy. The reaso