Read-only view of ByteArrayInputStream content

Archie Cobbs archie.cobbs at gmail.com
Wed Jul 10 16:00:13 UTC 2024


On Tue, Jul 9, 2024 at 1:42 PM Martin Desruisseaux <
martin.desruisseaux at geomatys.com> wrote:

>
> Basically, the BLOB API seems clearly designed to allow the implementation
> to stream the data on demand if it wants to (which is good), but as a side
> effect it doesn't provide a way for the caller to guarantee avoidance of
> copying the entire array (if the implementation happens to not stream the
> data on demand).
>
> Right. The wish to "unwrap" the ByteArrayInputStream original array come
> from the empirical observation that many of the JDBC drivers that we are
> using do not stream.
>

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()

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240710/24496d29/attachment-0001.htm>


More information about the core-libs-dev mailing list