Returns a slice (that is, a sub-array) of this instance. @param start >= 0; start index of the slice (inclusive) @param end >= start, <= size(); end index of the slice (exclusive) @return non-null; the slice
(int start, int end)
| 95 | * @return {@code non-null;} the slice |
| 96 | */ |
| 97 | public ByteArray slice(int start, int end) { |
| 98 | checkOffsets(start, end); |
| 99 | byte[] slicedOut = Arrays.copyOfRange(bytes, start, end); |
| 100 | return new ByteArray(slicedOut); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Returns the offset into the given array represented by the given |
no test coverage detected