Lines Matching refs:Byte
34 * Static utility methods pertaining to {@code byte} primitives, that are not
35 * already found in either {@link Byte} or {@link Arrays}, <i>and interpret
49 * {@code ((Byte) value).hashCode()}.
51 * @param value a primitive {@code byte} value
54 public static int hashCode(byte value) {
62 * @param array an array of {@code byte} values, possibly empty
63 * @param target a primitive {@code byte} value
67 public static boolean contains(byte[] array, byte target) {
68 for (byte value : array) {
80 * @param array an array of {@code byte} values, possibly empty
81 * @param target a primitive {@code byte} value
85 public static int indexOf(byte[] array, byte target) {
91 byte[] array, byte target, int start, int end) {
111 public static int indexOf(byte[] array, byte[] target) {
134 * @param array an array of {@code byte} values, possibly empty
135 * @param target a primitive {@code byte} value
139 public static int lastIndexOf(byte[] array, byte target) {
145 byte[] array, byte target, int start, int end) {
156 * For example, {@code concat(new byte[] {a, b}, new byte[] {}, new
157 * byte[] {c}} returns the array {@code {a, b, c}}.
159 * @param arrays zero or more {@code byte} arrays
163 public static byte[] concat(byte[]... arrays) {
165 for (byte[] array : arrays) {
168 byte[] result = new byte[length];
170 for (byte[] array : arrays) {
193 public static byte[] ensureCapacity(
194 byte[] array, int minLength, int padding) {
203 private static byte[] copyOf(byte[] original, int length) {
204 byte[] copy = new byte[length];
210 * Copies a collection of {@code Byte} instances into a new array of
211 * primitive {@code byte} values.
217 * @param collection a collection of {@code Byte} objects
223 public static byte[] toArray(Collection<Byte> collection) {
230 byte[] array = new byte[len];
232 array[i] = (Byte) boxedArray[i];
244 * {@code Byte} objects written to or read from it. For example, whether
251 public static List<Byte> asList(byte... backingArray) {
259 private static class ByteArrayAsList extends AbstractList<Byte>
261 final byte[] array;
265 ByteArrayAsList(byte[] array) {
269 ByteArrayAsList(byte[] array, int start, int end) {
283 @Override public Byte get(int index) {
290 return (target instanceof Byte)
291 && Bytes.indexOf(array, (Byte) target, start, end) != -1;
296 if (target instanceof Byte) {
297 int i = Bytes.indexOf(array, (Byte) target, start, end);
307 if (target instanceof Byte) {
308 int i = Bytes.lastIndexOf(array, (Byte) target, start, end);
316 @Override public Byte set(int index, Byte element) {
318 byte oldValue = array[start + index];
324 /*@Override*/ public List<Byte> subList(int fromIndex, int toIndex) {
370 byte[] toByteArray() {
373 byte[] result = new byte[size];