Unfortunately, you can't. What you are asking for essentially is C/C++ pointer arithmetic, and there is no such thing in Java.
However, if you are willing to use a different interface, you might have some luck with Commons Primitives ArrayByteList
. It's not a simple List<Byte>
, as it's backed by a true array of byte
s - thus there is no memory overhead due to using Byte
objects. You will still have some object overhead, but that's acceptable in practical instances.
Most importantly, it supports slices via the ArrayByteList.subList()
method, which does not produce a copy. You can check the source code, the slice is implemented as a reference to the original array plus two markers for begin and end positions.
However, keep in mind that avoiding the copy means that changes to the slice are reflected in the original array. It's probably what you want, but still be very careful - especially if you don't come from a C/C++ background, where these things are common practice.