fluo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Turner <ke...@deenlo.com>
Subject Re: New Blog Post
Date Thu, 10 Nov 2016 22:58:57 GMT
On Thu, Nov 10, 2016 at 5:20 PM, Dylan Hutchison
<dhutchis@cs.washington.edu> wrote:
> Thanks for writing the post Keith.
>
> How would you compare Fluo's Bytes to Guava's ImmutableList<Byte>?

I think the following elements are key for an immutable byte array wrapper.

 * good interoperability  with byte[], String, ByteBuffer,
InputStream, OutputStream, etc.
 * an efficient reusable builder that also interoperates with type
mentioned above
 * good hashCode, equals, and compareTo functions

A list representation might be nice, however the performance
implications you mentioned below may be severe. The list
implementation would provide some of the elements mentioned above.
Would still need to provide additional specialization for the interop.

>
> Bytes would be more efficient at face value because it used a byte[]
> internally rather than an Object[] (that is a Byte[]). Apart from that, I
> imagine that the two implementations share a lot of functionality, such as
> how to handle sub-arrays of a Bytes (= sublists of an immutable list, which
> Guava implements very nicely). Did Bytes take inspiration from Guava or was
> it built from the ground up?

Its slowly evolved over time, so its hard to remember. I think
inspiration was taken from parts of Guava, but I am not sure what
parts.  Also Java's String was an inspiration.

>
> On Nov 10, 2016 1:11 PM, "Keith Turner" <keith@deenlo.com> wrote:
>
> I just added a new blog post to the Fluo website.
>
> http://fluo.apache.org/blog/2016/11/10/immutable-bytes/

Mime
View raw message