Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Immutable container for a byte[] that supports subsequences, like String.substring() [closed]

Tags:

java

String.substring() efficiently reuses the underlying char[] within the String object, I'm wondering if there is an immutable container for byte[] arrays that supports a similar kind of efficient reuse of the underlying array.

Extra points if it can handle things like efficient append and prepend. Still extra points if its packaged for Maven.

Anyone know of such a thing?

like image 388
sanity Avatar asked Mar 29 '11 23:03

sanity


1 Answers

The most suitable thing that comes into my mind without going outside base SDK are java.nio Buffers, like ByteBuffer..

like image 143
Jack Avatar answered Oct 06 '22 23:10

Jack