Java needs an immutable byte array wrapper

Roman Kennke roman at kennke.org
Sat Nov 12 17:04:37 UTC 2016


Am Samstag, den 12.11.2016, 11:45 -0500 schrieb Keith Turner:
> While trying to design an API for Fluo, its become clear to me that
> Java could really benefit from an immutable byte array wrapper.
> Something like java.lang.String except for byte arrays instead of
> char
> arrays.  It would be nice if this new type interoperated well with
> byte[], String, ByteBuffer, InputStream, OutputStream etc.
> 
> I wrote the following blog post about my experiences with this issue
> while designing an API for Fluo.
> 
> http://fluo.apache.org/blog/2016/11/10/immutable-bytes/
> 
> Is there any reason something like this should not be added to Java?

You mean something like NIO ByteBuffers and related APIs?

Roman



More information about the discuss mailing list